- GET /tools returns ToolPageView{total,page,pageSize,records}, pageSize=0 keeps full-list mode
- App.vue adds pager below tools table; scope/audit/category pickers use allTools
- add backend pagination tests and front-end pager contract test
32 lines
909 B
JavaScript
32 lines
909 B
JavaScript
import { readFile } from 'node:fs/promises'
|
|
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
|
|
test('prototype interactions expose stable test ids', async () => {
|
|
const source = await readFile(new URL('../src/App.vue', import.meta.url), 'utf8')
|
|
const required = [
|
|
'admin-input-account',
|
|
'admin-input-password',
|
|
'admin-btn-login',
|
|
'admin-menu-tokens',
|
|
'admin-menu-clients',
|
|
'admin-menu-tools',
|
|
'admin-menu-scopes',
|
|
'admin-menu-audit',
|
|
'admin-input-user-search',
|
|
'admin-btn-issue-token',
|
|
'admin-btn-new-client',
|
|
'admin-table-clients',
|
|
'admin-issued-client-key',
|
|
'admin-table-tools',
|
|
'admin-tool-pager',
|
|
'admin-btn-new-scope',
|
|
'admin-table-scopes',
|
|
'admin-table-audit',
|
|
'admin-btn-logout'
|
|
]
|
|
for (const testId of required) {
|
|
assert.match(source, new RegExp(`data-testid=["']${testId}["']`), testId)
|
|
}
|
|
})
|