fix(tests) : fix stale unit tests for useToast and useEntityTypes
useToast.clearAll() now clears the dedup map to prevent test pollution, and useEntityTypes error test expectation matches actual French message. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -76,6 +76,7 @@ export function useToast() {
|
|||||||
|
|
||||||
const clearAll = (): void => {
|
const clearAll = (): void => {
|
||||||
toasts.value = []
|
toasts.value = []
|
||||||
|
recentMessages.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ describe('loadTypes', () => {
|
|||||||
expect(result.error).toBe('Network error')
|
expect(result.error).toBe('Network error')
|
||||||
expect(types.value).toEqual([])
|
expect(types.value).toEqual([])
|
||||||
expect(mockShowError).toHaveBeenCalledWith(
|
expect(mockShowError).toHaveBeenCalledWith(
|
||||||
expect.stringContaining('Network error'),
|
'Impossible de charger les types de composant.',
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user