test(12.2-05): SPA unit tests for the phase and the check-phase12.2 gate

- sessionKey, dateFormat, FileuploadField (protected thumbnails and
  keyboard reorder backstops), RelationChildModal, RelationPivotModal,
  RelationManager row actions and create-screen deferral, date and time
  list cells; typed deferred relation-schema and file-list fixtures
- scripts/check-phase12.2.sh: go, security (named tests, refuses missing
  or skipped), spa, openapi, dist, docs, hygiene and app stages, a
  detector self-test, one PASS or FAIL line per stage under --all
This commit is contained in:
Jakub Zych
2026-10-02 20:51:36 +02:00
parent 5b06b20ac3
commit d5494faa81
11 changed files with 1856 additions and 4 deletions

View File

@@ -75,3 +75,28 @@ describe('cell value (D-12)', () => {
expect(cell(toggle, null).find('[data-switch]').exists()).toBe(false)
})
})
describe('date and time cells (Phase 12.2)', () => {
const date = { ...listColumn('created_at'), key: 'released_on', type: 'date' } as ListColumn
const time = { ...listColumn('created_at'), key: 'opens_at', type: 'time' } as ListColumn
it('shows a stored date as is, never shifted by a time zone', () => {
expect(cell(date, '2026-10-02').text()).toBe('2026-10-02')
expect(cell(date, '2026-01-01T00:00:00Z').text()).toBe('2026-01-01')
expect(cell(date, '2026-10-02').find('span.tabular-nums').exists()).toBe(true)
})
it('shows a stored time without its seconds', () => {
expect(cell(time, '14:30:15').text()).toBe('14:30')
expect(cell(time, '08:05').text()).toBe('08:05')
expect(cell(time, '14:30:15').find('span.tabular-nums').exists()).toBe(true)
})
it('renders an empty date or time as a muted dash', () => {
for (const column of [date, time]) {
for (const value of [null, undefined, '']) {
expect(cell(column, value).find('[data-empty]').text()).toBe('—')
}
}
})
})