feat(editor): one tab order, vertical Plus list with the error count

This commit is contained in:
bchanot committed 2026-11-15 15:52:28 +01:00
1 parent b41c24b29d
commit ff21b0315e
11 files changed
+155 -75

No files matched your search

+20 -3
View File
@@ -51,9 +51,7 @@ describe('the Vérification tab badge', () => {
])('says « n erreur(s) » for %i blocking error(s)', async (count, name) => {
await openReady()
render(<EditorTabs active="general" tier="wide" onSelect={vi.fn()} />)
reportIssues(
Array.from({ length: count }, (_, at) => issue('error', at)),
)
reportIssues(Array.from({ length: count }, (_, at) => issue('error', at)))
expect(verificationTab()).toHaveTextContent(new RegExp(`^${name}$`))
})
@@ -76,3 +74,22 @@ describe('the Vérification tab badge', () => {
)
})
})
describe('« Plus » carries the count while Vérification sits under it', () => {
const plus = () => screen.getByRole('button', { name: /^Plus/ })
it('shows the count at the small tier, nothing at zero', async () => {
await openReady()
render(<EditorTabs active="general" tier="small" onSelect={vi.fn()} />)
reportIssues([])
expect(plus()).toHaveTextContent(/^Plus$/)
reportIssues([issue('error', 0), issue('error', 1)])
expect(plus()).toHaveTextContent(/^Plus 2 erreurs$/)
})
it('wide rows have no Plus button', async () => {
await openReady()
render(<EditorTabs active="general" tier="wide" onSelect={vi.fn()} />)
expect(screen.queryByRole('button', { name: /^Plus/ })).toBeNull()
})
})