style(applications): flatten edit dialog sections
This commit is contained in:
@@ -8,7 +8,8 @@ import ts from 'typescript';
|
||||
|
||||
const compiled = ts.transpileModule(fs.readFileSync(new URL('../src/i18n/translations.ts', import.meta.url), 'utf8'), { compilerOptions: { module: ts.ModuleKind.ESNext } }).outputText;
|
||||
const { translations } = await import(`data:text/javascript;base64,${Buffer.from(compiled).toString('base64')}`);
|
||||
const out = path.resolve(import.meta.dirname, '../../docs/i18n/evidence/date-widgets');
|
||||
const out = path.resolve(import.meta.dirname, process.env.A3_EVIDENCE_DIR ?? '../../docs/i18n/evidence/date-widgets');
|
||||
const flatEdit = process.env.A3_FLAT_EDIT === '1';
|
||||
fs.mkdirSync(out, { recursive: true });
|
||||
const report = { journeys: [], captures: [], writes: [], errors: [], unavailableReads: [], blockedExternal: [] };
|
||||
const browser = await chromium.launch();
|
||||
@@ -81,6 +82,12 @@ try {
|
||||
const titleId = await initialEdit.getAttribute('aria-labelledby');
|
||||
assert.ok(titleId);
|
||||
const edit = page.locator(`[role="dialog"][aria-labelledby="${titleId}"]`);
|
||||
if (flatEdit) {
|
||||
await expect(edit.locator('.MuiDialogContent-root .MuiPaper-outlined')).toHaveCount(0);
|
||||
for (const label of [copy.editJobApplicationDetails, copy.editJobStatusUpdate, copy.editJobRoleDetails, copy.editJobAttachmentsChecklist]) {
|
||||
await expect(edit.getByRole('heading', { name: label, exact: true })).toBeVisible();
|
||||
}
|
||||
}
|
||||
const deadline = edit.getByRole('group', { name: copy.editJobDeadline, exact: true });
|
||||
await assertDay(deadline, 23);
|
||||
await edit.getByRole('textbox', { name: copy.editJobJobTitle, exact: true }).fill('Retain teacher draft');
|
||||
@@ -92,6 +99,7 @@ try {
|
||||
await expect(edit.getByRole('textbox', { name: copy.editJobJobTitle, exact: true })).toHaveValue('Retain teacher draft');
|
||||
assert.equal(detailReads, reads); assert.equal(writes.length, 0);
|
||||
for (const label of [copy.editJobAppliedOn, copy.editJobStatusChangedOn, copy.editJobReplyReceivedOn, copy.editJobFollowUpOn, copy.editJobDeadline]) await choose24(edit.getByRole('group', { name: label, exact: true }), label === copy.editJobDeadline);
|
||||
if (flatEdit) await edit.locator('.MuiDialogContent-root').evaluate(node => { node.scrollTop = 0; });
|
||||
await capture('edit');
|
||||
await edit.getByRole('button', { name: copy.save, exact: true }).click();
|
||||
await expect(edit).toBeHidden();
|
||||
|
||||
Reference in New Issue
Block a user