Fix CI: untrack docs prose, correct two stale frontend specs
wilm has been red for eight consecutive runs across backend, gates and frontend. Three failures, two unrelated causes, neither introduced by the endpoint agent work. docs/ prose (backend + gates): The docs gates detect a published checkout by the ABSENCE of docs/*.md, because docs/ becomes the wiki on that side. DEV-BUILD-TEST.md and PLUGIN-HOOKS.md were committed in unrelated changes, which made CI look like an internal checkout carrying almost no prose. test_there_are_docs_ to_check then failed on `assert 3 > 20`, test_the_map_itself_is_current failed on a generated PROJECT-MAP.md that is correctly untracked, and check-gates-ran.sh failed on the resulting skip - a skipped gate reports green and checks nothing, so it refuses to accept one. The existing .gitignore comment predicted this exactly and was defeated by naming files individually. Untracked both (kept on disk) and replaced the per-file list with docs/*.md so the next authored doc cannot reintroduce it. Scoped to the top level: docs/notes/ prose and docs/openapi.json stay tracked, and the gates only glob docs/*.md. Frontend specs: getEntraDeviceUrls() gained lapsUrl and loaded, but two siteSettings specs still asserted the old two-key shape with toEqual, which is exact-match. The implementation is correct - loaded is what lets a caller distinguish a failed fetch from an unconfigured site, since both read as empty strings - so the specs were brought up to the current shape rather than the return value narrowed. pinnedPanels.spec.js sliced 420 characters from getEntraDeviceUrls() and asserted the finally block appeared inside it. Adding the retry logic pushed finally past that offset, so a correct implementation reported as "the finally is missing". Rebounded the slice to the function's own extent, matching the structural approach already used elsewhere in this file for the same reason. Verified by mutation: renaming the flag in the source fails the test, which also caught that the spec reads plugins/computers/frontend/views/PCDetail.vue and not the .plugins-staged build copy.
This commit is contained in:
@@ -88,9 +88,14 @@ describe('the header cloud identity block', () => {
|
||||
|
||||
it('marks the templates settled even when the fetch fails', () => {
|
||||
// Otherwise a down settings backend hides the block permanently.
|
||||
// Bounded by the function's own closing brace rather than a character
|
||||
// count: a fixed window silently excluded the finally block as soon as
|
||||
// the retry logic grew, which reported as "the finally is missing" when
|
||||
// the real code was correct. Slice to the next top-level declaration.
|
||||
const source = pcDetailSource()
|
||||
const start = source.indexOf('getEntraDeviceUrls()')
|
||||
const block = source.slice(start, start + 420)
|
||||
const start = source.indexOf('async function loadPortalTemplates')
|
||||
const next = source.indexOf('\nonUnmounted(', start)
|
||||
const block = source.slice(start, next === -1 ? undefined : next)
|
||||
expect(block).toContain('finally')
|
||||
expect(block).toContain('portalTemplatesLoaded.value = true')
|
||||
})
|
||||
|
||||
@@ -70,6 +70,8 @@ describe('loading', () => {
|
||||
expect(await settings.getEntraDeviceUrls()).toEqual({
|
||||
entraUrl: 'https://entra/{id}',
|
||||
intuneUrl: 'https://intune/{id}',
|
||||
lapsUrl: '',
|
||||
loaded: true,
|
||||
})
|
||||
expect(list).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
@@ -82,7 +84,11 @@ describe('failure', () => {
|
||||
const settings = await freshModule()
|
||||
|
||||
expect(await settings.getFacilityName()).toBe('ShopDB')
|
||||
expect(await settings.getEntraDeviceUrls()).toEqual({ entraUrl: '', intuneUrl: '' })
|
||||
// loaded:false is the point - a failed fetch and an unconfigured site both
|
||||
// read as empty strings, and the caller needs to tell them apart.
|
||||
expect(await settings.getEntraDeviceUrls()).toEqual({
|
||||
entraUrl: '', intuneUrl: '', lapsUrl: '', loaded: false,
|
||||
})
|
||||
})
|
||||
|
||||
it('does not hammer a backend that is down', async () => {
|
||||
|
||||
Reference in New Issue
Block a user