test(10-05): bring every SPA module, composable and component under Vitest
- 41 unit and component suites under admin/tests/{app,state,shell,list,form,relation,views,ui}
covering states and a11y roles; every src module is imported by a test
- typed fixture helper assigns each JSON fixture to its generated OpenAPI type
- fix: iconFor ignores inherited object members such as "constructor"
- fix: field controls import ./control instead of the registry (import cycle
left a renderer unregistered depending on module load order)
- fix: dropdown shows the placeholder for an unknown stored value next to an emptyOption
- fix: list announces a failed schema load even when the rows arrive after it
- tailwind no longer scans admin/tests; boardwalk/dist rebuilt
This commit is contained in:
@@ -39,7 +39,11 @@ const schema = ref<ListSchema | null>(null)
|
||||
const rows = ref<AdminRecord[]>([])
|
||||
const meta = ref<ListMeta | null>(null)
|
||||
const loading = ref(true)
|
||||
const failed = ref(false)
|
||||
// The schema and the rows load in parallel; either failing is announced, so a
|
||||
// list response that arrives after a failed schema never hides the failure.
|
||||
const schemaFailed = ref(false)
|
||||
const listFailed = ref(false)
|
||||
const failed = computed(() => schemaFailed.value || listFailed.value)
|
||||
const selected = ref<RowId[]>([])
|
||||
const deleting = ref(false)
|
||||
const confirm = useConfirm()
|
||||
@@ -92,24 +96,22 @@ let generation = 0
|
||||
async function loadList(): Promise<void> {
|
||||
const current = ++generation
|
||||
loading.value = true
|
||||
failed.value = false
|
||||
listFailed.value = false
|
||||
const result = await api.GET('/{vendor}/{plugin}/{controller}', { params: { path, query: query.value } })
|
||||
if (current !== generation) {
|
||||
return
|
||||
}
|
||||
rows.value = result.data?.data ?? []
|
||||
meta.value = result.data?.meta ?? null
|
||||
failed.value = !result.data
|
||||
listFailed.value = !result.data
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
async function load(): Promise<void> {
|
||||
const result = await api.GET('/{vendor}/{plugin}/{controller}/schema/list', { params: { path } })
|
||||
schema.value = result.data?.data ?? null
|
||||
if (!schema.value) {
|
||||
failed.value = true
|
||||
loading.value = false
|
||||
}
|
||||
schemaFailed.value = !schema.value
|
||||
|
||||
}
|
||||
|
||||
void load()
|
||||
|
||||
Reference in New Issue
Block a user