UI: Fix flaky time-related tests (#19521)

This commit is contained in:
Chelsea Shaw
2023-03-22 13:19:11 -05:00
committed by GitHub
parent 3dbe94678f
commit bf2f1a88d6
65 changed files with 643 additions and 525 deletions

View File

@@ -198,12 +198,10 @@ module('Integration | Component | mfa-form', function (hooks) {
await fillIn('[data-test-mfa-passcode]', code);
later(() => cancelTimers(), 50);
await click('[data-test-mfa-validate]');
const expectedTime = code === 'used' ? '45' : '15';
assert
.dom('[data-test-mfa-countdown]')
.hasText(
code === 'used' ? '45' : '15',
'countdown renders with correct initial value from error response'
);
.includesText(expectedTime, 'countdown renders with correct initial value from error response');
assert.dom('[data-test-mfa-validate]').isDisabled('Button is disabled during countdown');
assert.dom('[data-test-mfa-passcode]').isDisabled('Input is disabled during countdown');
assert.dom('[data-test-inline-error-message]').exists('Alert message renders');