19 lines
631 B
TypeScript
19 lines
631 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { failureMessage } from '@/admin/labels'
|
|
import { en } from '@/i18n/en'
|
|
import { fr } from '@/i18n/fr'
|
|
|
|
describe('failure messages of the submission', () => {
|
|
it.each(['round.open', 'view.asset.unknown'] as const)(
|
|
'%s has its own wording, never the generic unavailable one',
|
|
(kind) => {
|
|
for (const dict of [fr, en]) {
|
|
const t = (key: string) => dict[key]
|
|
const message = failureMessage(t, kind)
|
|
expect(message).toBe(dict[`admin.failure.${kind}`])
|
|
expect(message).not.toBe(dict['admin.failure.unavailable'])
|
|
}
|
|
},
|
|
)
|
|
})
|