💄 style(vscode): 代码阅读「问过 N 次」的历史默认展开

This commit is contained in:
cruldra committed 2026-09-30 09:23:29 +08:00
1 parent 90268c7c67
commit de05d13dab
3 files changed
+10 -7

No files matched your search

@@ -29,11 +29,14 @@ describe('块下面的问答区', () => {
expect(render({})).toBe('')
})
it('问过、没展开:只露一行「问过 N 次」,点开才看历史', () => {
it('问过、没展开:一行「问过 N 次」,下面默认摊开灰字历史,没有输入框', () => {
const html = render({ history: HISTORY })
expect(html).toContain('data-collapsed')
expect(text(html)).toBe('问过 2 次')
expect(html).toContain('aria-expanded="false"')
expect(text(html)).toMatch(/^问过 2 次/)
expect(html).toContain('aria-expanded="true"')
expect(html.match(/data-history=""/g)).toHaveLength(2)
expect(text(html)).toContain('为什么普通用户不能看别人的资料?3 天前')
expect(text(html)).toContain('UserRole 还有哪些角色?昨天')
expect(html).not.toContain('<textarea')
})