32 lines
1.2 KiB
JavaScript
32 lines
1.2 KiB
JavaScript
import { readFileSync } from 'node:fs'
|
|
import assert from 'node:assert/strict'
|
|
import test from 'node:test'
|
|
|
|
const src = file => readFileSync(new URL(`../src/${file}`, import.meta.url), 'utf8')
|
|
|
|
test('navigation GoodDrive sans Récents ni Favoris', () => {
|
|
const nav = src('config/navigation.js')
|
|
assert.doesNotMatch(nav, /recent|starred|Récents|Favoris/)
|
|
assert.doesNotMatch(nav, /Espaces & invitations/)
|
|
assert.match(src('components/drive/ContextActions.jsx'), /Accès et invitations/)
|
|
assert.match(nav, /Corbeille/)
|
|
})
|
|
|
|
test('inscription sur invitation : soumission réelle et formulaire minimal', () => {
|
|
const page = src('pages/InvitationPage.jsx')
|
|
assert.match(page, /<form onSubmit=\{submit\}/)
|
|
assert.match(page, /<Button type="submit"/)
|
|
assert.doesNotMatch(page, /Permissions reçues/)
|
|
assert.match(page, /drive\.inviteAccept\(token/)
|
|
})
|
|
|
|
test('aucune action favorite dans la liste, la fenêtre ou le contrôleur', () => {
|
|
for (const file of [
|
|
'components/drive/FileList.jsx',
|
|
'components/drive/dialogs/ItemActionsDialog.jsx',
|
|
'hooks/useDriveController.js',
|
|
]) {
|
|
assert.doesNotMatch(src(file), /is_starred|handleAction\('star'\)/, file)
|
|
}
|
|
})
|