test(app): accept the Cupertino create prompt at 2x without role assumptions
This commit is contained in:
@@ -178,7 +178,14 @@ try {
|
||||
await delay(400);
|
||||
};
|
||||
|
||||
// Null while the prompt is closed; true/false is the Create button's state.
|
||||
// The prompt is open as soon as its native alert-dialog surface exists. The
|
||||
// Create action's button role/aria-disabled is host- and scale-dependent on
|
||||
// the web semantics layer, so the disabled state is asserted module-side for
|
||||
// Material and by widget tests for Cupertino.
|
||||
const promptOpen = () =>
|
||||
evaluate("Boolean(document.querySelector('[role=alertdialog]'))");
|
||||
|
||||
// Null unless a Material Create button exposes its disabled state.
|
||||
const createDisabled = () =>
|
||||
evaluate(`(() => {
|
||||
const el = [...document.querySelectorAll('flt-semantics')].find(
|
||||
@@ -232,7 +239,7 @@ try {
|
||||
await assertBody('Create pipeline from this template');
|
||||
|
||||
await clickLabel('Create pipeline from this template');
|
||||
await waitFor(() => createDisabled().then((value) => value !== null), 'the create prompt');
|
||||
await waitFor(promptOpen, 'the create prompt');
|
||||
await assertBody('Create from Release workflow');
|
||||
await assertBody('New pipeline name (required)');
|
||||
await assertBody("Creates a new draft pipeline on the server from this template's source; it is not run.");
|
||||
@@ -301,7 +308,7 @@ try {
|
||||
});
|
||||
|
||||
await clickLabel('Close');
|
||||
await waitFor(async () => (await createDisabled()) === null, 'the prompt to close');
|
||||
await waitFor(async () => !(await promptOpen()), 'the prompt to close');
|
||||
checks.push({
|
||||
check: 'Close dismissed the prompt without another request',
|
||||
state: await state(),
|
||||
|
||||
Reference in New Issue
Block a user