Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix v3-web-component va-segmented-progress-bar Safari focus bug #27784

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
de37f5b
[WIP] Fix v3-web-component va-segmented-progress-bar Safari focus bug
tlei123 Feb 1, 2024
1be8b20
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 2, 2024
e5eb272
Temporarily disable dev-page-links in 21-0966 form-config
tlei123 Feb 2, 2024
ad6202d
Temporarily disable dev-page-links option in 40-0247 form-config
tlei123 Feb 2, 2024
1ab1e61
Fix shadow-host queries in FormNav & FormPage focus methods
tlei123 Feb 2, 2024
5a48c63
Remove remnant custom-focus references from 40-0127 form-config
tlei123 Feb 2, 2024
2d2bbf0
Add note to JSDoc for customScrollAndFocus method
tlei123 Feb 3, 2024
072ec3c
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 5, 2024
2835673
Update FormPage unit-tests
tlei123 Feb 5, 2024
c247518
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 5, 2024
96c567d
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 5, 2024
fe8a5d5
Refactor appeals shared unit-test
tlei123 Feb 5, 2024
6be21d4
Restore local-dev-page-links in 21-0966 form-config
tlei123 Feb 5, 2024
fddd64d
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 6, 2024
e60ab02
Revert "Fix shadow-host queries in FormNav & FormPage focus methods"
tlei123 Feb 6, 2024
dfd918b
Revert "Revert "Fix shadow-host queries in FormNav & FormPage focus m…
tlei123 Feb 7, 2024
80d1aab
Refactor focus methods and FormPage method-calls
tlei123 Feb 7, 2024
2d2d8cc
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 9, 2024
1e20664
Fix FormNav focus async-code
tlei123 Feb 10, 2024
dbd529a
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 12, 2024
036db33
Commit 20-10207 file-deletions left over from main-branch merge
tlei123 Feb 16, 2024
6b7e6cc
Update 21-0966 local-dev-links-config and local-mock-api responses
tlei123 Feb 16, 2024
64958e9
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 16, 2024
144251f
Update 21-0247 local-dev-links config and local-mock-api responses
tlei123 Feb 16, 2024
d1c7296
Commit 20-10207 file-deletions left-over from main-merge
tlei123 Feb 16, 2024
4bc551f
WIP Refactor FormNav scroll and focus
tlei123 Feb 17, 2024
959db71
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 19, 2024
c2a8616
Refactor FormPage focusForm method
tlei123 Feb 19, 2024
ce2213d
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 19, 2024
c9f7c73
Update 40-0247 SIP mock-api-responses
tlei123 Feb 20, 2024
be08c47
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 20, 2024
d9c1cee
Fix unwanted field-input-triggered focusing in FormNav effect-hook
tlei123 Feb 21, 2024
0f4abb8
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 21, 2024
53d2c2a
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 21, 2024
92d47b6
Remove console.logs
tlei123 Feb 21, 2024
afd59ee
Add new unit-tests for getFormNavFocusTargetRoot & handleFormNavFocus
tlei123 Feb 21, 2024
5210aca
Fix customScrollAndFocus for va-segmented-progress-bar
tlei123 Feb 21, 2024
d5dd13f
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 21, 2024
464a456
Fix anomalous PP10207 file-deletions
tlei123 Feb 22, 2024
22e90ee
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 22, 2024
7eeb750
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 22, 2024
f18466a
Update 21-10210 utils unit-tests
tlei123 Feb 22, 2024
b92eadf
Refactor FormNav & FormPage scroll/focus code.
tlei123 Feb 22, 2024
4c22c7c
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 22, 2024
128d0fb
Revert "Refactor FormNav & FormPage scroll/focus code."
tlei123 Feb 22, 2024
0f99cbc
Revert "Revert "Refactor FormNav & FormPage scroll/focus code.""
tlei123 Feb 22, 2024
55da566
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 23, 2024
164ac95
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 23, 2024
033cb4f
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 26, 2024
725fecd
CI-skip secure-messaging-compose e2e-spec due to flakiness
tlei123 Feb 26, 2024
3a99559
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 26, 2024
b059f87
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 27, 2024
5b99246
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 28, 2024
5d243d1
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 28, 2024
3830f26
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Feb 29, 2024
91d1473
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Mar 1, 2024
5450bf2
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Mar 1, 2024
14d40e7
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Mar 4, 2024
239ea49
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Mar 4, 2024
64d8b23
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Mar 5, 2024
d7c500e
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Mar 6, 2024
0834304
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Mar 6, 2024
d221816
Merge branch 'main' into simple-forms/978-safari-focus-2
tlei123 Mar 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2,7 +2,7 @@
import { expect } from 'chai';
import { render, waitFor } from '@testing-library/react';

import { $ } from 'platform/forms-system/src/js/utilities/ui';

Check warning on line 5 in src/applications/appeals/shared/tests/utils/focus.unit.spec.js

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/appeals/shared/tests/utils/focus.unit.spec.js:5:1:Importing from platform via platform/forms-system is deprecated. Import from @department-of-veterans-affairs/platform-forms-system instead or check babel.config.json for an alias to the import.

import { focusIssue, focusRadioH3, focusAlertH3 } from '../../utils/focus';
import { LAST_ISSUE } from '../../constants';
Expand Down Expand Up @@ -88,7 +88,7 @@
</va-radio>
) : (
<div className="nav-header">
<h2>test 2</h2>
<h2 id="nav-form-header">test 2</h2>
</div>
)}
</div>,
Expand All @@ -109,7 +109,7 @@

await focusRadioH3();
await waitFor(() => {
const target = $('h2', container);
const target = $('#nav-form-header', container);
expect(document.activeElement).to.eq(target);
});
});
Expand Down
21 changes: 4 additions & 17 deletions src/applications/simple-forms/40-0247/config/form.js
@@ -1,6 +1,6 @@
// we're not using JSON schema for this form.
import environment from 'platform/utilities/environment';

Check warning on line 2 in src/applications/simple-forms/40-0247/config/form.js

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/simple-forms/40-0247/config/form.js:2:1:Importing from platform via platform/utilities is deprecated. Import from @department-of-veterans-affairs/platform-utilities instead or check babel.config.json for an alias to the import.
import footerContent from 'platform/forms/components/FormFooter';

Check warning on line 3 in src/applications/simple-forms/40-0247/config/form.js

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/simple-forms/40-0247/config/form.js:3:1:Importing from platform via platform/forms is deprecated. Import from @department-of-veterans-affairs/platform-forms instead or check babel.config.json for an alias to the import.
import getHelp from '../../shared/components/GetFormHelp';

import manifest from '../manifest.json';
Expand All @@ -18,24 +18,22 @@
import addlCertsYNPg from '../pages/additionalCertificatesYesNo';
import addlCertsReqPg from '../pages/additionalCertificatesRequest';
import transformForSubmit from './submit-transformer';
import { getInitialData, pageFocusScroll } from '../helpers';
import { getInitialData } from '../helpers';

// mock-data import for local development
import testData from '../tests/e2e/fixtures/data/test-data.json';

const mockData = testData.data;

// TODO: remove useCustomScrollAndFocus & scrollAndFocusTarget props once
// FormNav's default focus issue's resolved
/** @type {FormConfig} */
const formConfig = {
rootUrl: manifest.rootUrl,
urlPrefix: '/',
submitUrl: `${environment.API_URL}/simple_forms_api/v1/simple_forms`,
trackingPrefix: '0247-pmc',
dev: {
showNavLinks: !window.Cypress,
},
// dev: {
// showNavLinks: !window.Cypress,
// },
introduction: IntroductionPage,
confirmation: ConfirmationPage,
preSubmitInfo: {
Expand Down Expand Up @@ -73,7 +71,6 @@
enum: [true],
},
},
useCustomScrollAndFocus: true,
chapters: {
veteranPersonalInfoChapter: {
title: 'Veteran’s or Reservist’s personal information',
Expand All @@ -87,7 +84,6 @@
uiSchema: vetPersInfoPg.uiSchema,
schema: vetPersInfoPg.schema,
pageClass: 'veteran-personal-information',
scrollAndFocusTarget: pageFocusScroll(),
},
},
},
Expand All @@ -100,7 +96,6 @@
uiSchema: vetIdInfoPg.uiSchema,
schema: vetIdInfoPg.schema,
pageClass: 'veteran-identification-information',
scrollAndFocusTarget: pageFocusScroll(),
},
},
},
Expand All @@ -113,7 +108,6 @@
uiSchema: vetSupportDocsPg.uiSchema,
schema: vetSupportDocsPg.schema,
pageClass: 'veteran-supporting-documentation',
scrollAndFocusTarget: pageFocusScroll(),
},
},
},
Expand All @@ -126,7 +120,6 @@
uiSchema: requestTypePg.uiSchema,
schema: requestTypePg.schema,
pageClass: 'request-type',
scrollAndFocusTarget: pageFocusScroll(),
},
},
},
Expand All @@ -139,7 +132,6 @@
uiSchema: appPersInfoPg.uiSchema,
schema: appPersInfoPg.schema,
pageClass: 'applicant-personal-information',
scrollAndFocusTarget: pageFocusScroll(),
},
},
},
Expand All @@ -152,7 +144,6 @@
uiSchema: appAddrPg.uiSchema,
schema: appAddrPg.schema,
pageClass: 'applicant-address',
scrollAndFocusTarget: pageFocusScroll(),
},
},
},
Expand All @@ -165,7 +156,6 @@
uiSchema: appContactInfoPg.uiSchema,
schema: appContactInfoPg.schema,
pageClass: 'applicant-contact-information',
scrollAndFocusTarget: pageFocusScroll(),
},
},
},
Expand All @@ -178,7 +168,6 @@
uiSchema: certsPg.uiSchema,
schema: certsPg.schema,
pageClass: 'certificates',
scrollAndFocusTarget: pageFocusScroll(),
},
},
},
Expand All @@ -191,7 +180,6 @@
uiSchema: addlCertsYNPg.uiSchema,
schema: addlCertsYNPg.schema,
pageClass: 'additional-certificates-yes-no',
scrollAndFocusTarget: pageFocusScroll(),
},
additionalCertificatesRequestPage: {
path: 'additional-certificates-request',
Expand All @@ -200,7 +188,6 @@
uiSchema: addlCertsReqPg.uiSchema,
schema: addlCertsReqPg.schema,
pageClass: 'additional-certificates-request',
scrollAndFocusTarget: pageFocusScroll(),
},
},
},
Expand Down
19 changes: 1 addition & 18 deletions src/applications/simple-forms/40-0247/helpers.js
Expand Up @@ -2,14 +2,9 @@

import moment from 'moment';

import recordEvent from 'platform/monitoring/record-event';

Check warning on line 5 in src/applications/simple-forms/40-0247/helpers.js

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/simple-forms/40-0247/helpers.js:5:1:Importing from platform via platform/monitoring is deprecated. Import from @department-of-veterans-affairs/platform-monitoring instead or check babel.config.json for an alias to the import.
import { $$ } from 'platform/forms-system/src/js/utilities/ui';

Check warning on line 6 in src/applications/simple-forms/40-0247/helpers.js

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/simple-forms/40-0247/helpers.js:6:1:Importing from platform via platform/forms-system is deprecated. Import from @department-of-veterans-affairs/platform-forms-system instead or check babel.config.json for an alias to the import.
import {
getScrollOptions,
focusElement,
waitForRenderThenFocus,
} from 'platform/utilities/ui';
import scrollTo from 'platform/utilities/ui/scrollTo';
import { focusElement } from 'platform/utilities/ui';

Check warning on line 7 in src/applications/simple-forms/40-0247/helpers.js

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/simple-forms/40-0247/helpers.js:7:1:Importing from platform via platform/utilities is deprecated. Import from @department-of-veterans-affairs/platform-utilities instead or check babel.config.json for an alias to the import.

export function trackNoAuthStartLinkClick() {
recordEvent({ event: 'no-login-start-form' });
Expand All @@ -21,18 +16,6 @@
: undefined;
}

export const pageFocusScroll = () => {
const focusSelector =
'va-segmented-progress-bar[uswds][heading-text][header-level="2"]';
const scrollToName = 'v3SegmentedProgressBar';
return () => {
waitForRenderThenFocus(focusSelector);
setTimeout(() => {
scrollTo(scrollToName, getScrollOptions({ offset: 0 }));
}, 100);
};
};

export const supportingDocsDescription = (
<div className="supp-docs-description">
<p>We prefer that you upload the Veteran’s or Reservist’s DD214.</p>
Expand Down
69 changes: 41 additions & 28 deletions src/platform/forms-system/src/js/components/FormNav.jsx
Expand Up @@ -14,7 +14,9 @@
focusByOrder,
customScrollAndFocus,
defaultFocusSelector,
waitForRenderThenFocus,
} from '../../../../utilities/ui';
import { querySelectorWithShadowRoot } from '../../../../utilities/ui/webComponents';

import { REVIEW_APP_DEFAULT_MESSAGE } from '../constants';

Expand Down Expand Up @@ -98,6 +100,43 @@
: `Step ${currentChapterDisplay} of ${chaptersLengthDisplay}: ${chapterName ||
''}`;

const handleFocus = async () => {
let root = document.querySelector('#react-root');
tlei123 marked this conversation as resolved.
Show resolved Hide resolved
if (formConfig.v3SegmentedProgressBar) {
// Need to provide shadowRoot for focusing on shadow-DOM elements
const shadowHost = await querySelectorWithShadowRoot(
'va-segmented-progress-bar',
);
root = shadowHost.shadowRoot;
}

return () => {
tlei123 marked this conversation as resolved.
Show resolved Hide resolved
// Check main toggle to enable custom focus; the unmounting of the page
// before the review & submit page may cause the customScrollAndFocus
// function to be called inadvertently
if (
!(
page.chapterKey === 'review' ||
window.location.pathname.endsWith('review-and-submit')
)
) {
if (formConfig.useCustomScrollAndFocus) {
customScrollAndFocus(page.scrollAndFocusTarget, index);
} else {
waitForRenderThenFocus(defaultFocusSelector, root, 400);
tlei123 marked this conversation as resolved.
Show resolved Hide resolved
}
} else {
// h2 fallback for review page
focusByOrder([defaultFocusSelector, 'h2'], root);
}
};
};

// Handle focus on mount
useEffect(() => {
handleFocus();
}, []);

Check warning on line 138 in src/platform/forms-system/src/js/components/FormNav.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/platform/forms-system/src/js/components/FormNav.jsx:138:6:React Hook useEffect has a missing dependency: 'handleFocus'. Either include it or remove the dependency array.
tlei123 marked this conversation as resolved.
Show resolved Hide resolved

// The goal with this is to quickly "remove" the header from the DOM, and
// immediately re-render the component with the header included.
// `current` changes when the form chapter changes, and when this happens
Expand All @@ -111,35 +150,9 @@
} else if (current === index) {
setIndex(index - 1);
}

return () => {
// Check main toggle to enable custom focus; the unmounting of the page
// before the review & submit page may cause the customScrollAndFocus
// function to be called inadvertently
if (
!(
page.chapterKey === 'review' ||
window.location.pathname.endsWith('review-and-submit')
)
) {
if (formConfig.useCustomScrollAndFocus && page.scrollAndFocusTarget) {
customScrollAndFocus(page.scrollAndFocusTarget, index);
} else {
focusByOrder([defaultFocusSelector, 'h2']);
}
} else {
// h2 fallback for confirmation page
focusByOrder([defaultFocusSelector, 'h2']);
}
};
handleFocus();
},
[
current,
formConfig.useCustomScrollAndFocus,
index,
page.chapterKey,
page.scrollAndFocusTarget,
],
[current, index],

Check warning on line 155 in src/platform/forms-system/src/js/components/FormNav.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/platform/forms-system/src/js/components/FormNav.jsx:155:5:React Hook useEffect has a missing dependency: 'handleFocus'. Either include it or remove the dependency array.
);

const v3SegmentedProgressBar = formConfig?.v3SegmentedProgressBar;
Expand Down
19 changes: 15 additions & 4 deletions src/platform/forms-system/src/js/containers/FormPage.jsx
Expand Up @@ -5,7 +5,7 @@
import classNames from 'classnames';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import { getDefaultFormState } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
import {

Check warning on line 8 in src/platform/forms-system/src/js/containers/FormPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/platform/forms-system/src/js/containers/FormPage.jsx:8:1:Importing from platform via platform/utilities is deprecated. Import from @department-of-veterans-affairs/platform-utilities instead or check babel.config.json for an alias to the import.
isReactComponent,
focusElement,
customScrollAndFocus,
Expand All @@ -17,20 +17,31 @@
import FormNavButtons from '../components/FormNavButtons';
import SchemaForm from '../components/SchemaForm';
import { setData, uploadFile } from '../actions';
import {

Check warning on line 20 in src/platform/forms-system/src/js/containers/FormPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/platform/forms-system/src/js/containers/FormPage.jsx:20:1:Dependency cycle detected.
getNextPagePath,
getPreviousPagePath,
checkValidPagePath,
} from '../routing';
import { DevModeNavLinks } from '../components/dev/DevModeNavLinks';
import { stringifyUrlParams } from '../helpers';
import { querySelectorWithShadowRoot } from '../../../../utilities/ui/webComponents';

function focusForm(route, index) {
async function focusForm(route, index) {
tlei123 marked this conversation as resolved.
Show resolved Hide resolved
const { useCustomScrollAndFocus, v3SegmentedProgressBar } = route.formConfig;
const { scrollAndFocusTarget } = route.pageConfig;
// Check main toggle to enable custom focus
if (route.formConfig?.useCustomScrollAndFocus) {
customScrollAndFocus(route.pageConfig?.scrollAndFocusTarget, index);
if (useCustomScrollAndFocus) {
customScrollAndFocus(scrollAndFocusTarget, index);
} else {
focusElement(defaultFocusSelector);
let root = document.querySelector('#react-root');
if (v3SegmentedProgressBar) {
// Need to provide shadowRoot to focus on shadow-DOM elements
const shadowHost = await querySelectorWithShadowRoot(
'va-segmented-progress-bar',
);
root = shadowHost.shadowRoot;
}
focusElement(defaultFocusSelector, {}, root);
}
}

Expand Down
Expand Up @@ -925,11 +925,11 @@ describe('Schemaform <FormPage>', () => {
).to.deep.equal({ arrayProp: [{}], someOtherProp: 'asdf' });
});

it('should focus on ".nav-header > h2" when useCustomScrollAndFocus is not set in form config', async () => {
it('should focus on ".nav-header > h2" in pre-v3 forms when useCustomScrollAndFocus is not set in form config', async () => {
const CustomPage = () => (
<div id="main" className="nav-header">
<div name="topScrollElement" />
<h2>H2</h2>
<h2 id="nav-form-header">H2</h2>
<div name="topContentElement" />
<h3>H3</h3>
</div>
Expand All @@ -950,28 +950,71 @@ describe('Schemaform <FormPage>', () => {
});
});

it('should focus on "#main h3" when useCustomScrollAndFocus is set in form config', async () => {
const CustomPage = () => (
<div id="main">
it('should focus on ".usa-step-indicator__heading" in v3 forms when useCustomScrollAndFocus is not set in form config', async () => {
const CustomPageV3 = () => (
<div id="main" className="nav-header">
<div name="topScrollElement" />
<h2>H2</h2>
<div name="topContentElement" />
<va-segmented-progress-bar
total="7"
current="1"
uswds="true"
heading-text="Your identity"
name="v3SegmentedProgressBar"
header-level="2"
className="hydrated"
>
<div className="usa-step-indicator__header">
<h2 className="usa-step-indicator__heading">
<span className="usa-step-indicator__heading-counter">
<span className="usa-sr-only">Step</span>
<span className="usa-step-indicator__current-step">1</span>
<span className="usa-step-indicator__total-steps"> of 7</span>
</span>
<span className="usa-step-indicator__heading-text">H2</span>
</h2>
</div>
</va-segmented-progress-bar>
<h3>H3</h3>
</div>
);
render(
<FormPage
form={makeBypassForm(CustomPage)()}
form={makeBypassForm(CustomPageV3)()}
route={{
...makeBypassRoute(CustomPage)(),
formConfig: { useCustomScrollAndFocus: true },
...makeBypassRoute(CustomPageV3)(),
formConfig: { useCustomScrollAndFocus: false },
}}
location={location}
/>,
);

it('should focus on "#main h3" when useCustomScrollAndFocus is set in form config', async () => {
const CustomPage = () => (
<div id="main">
<div name="topScrollElement" />
<h2>H2</h2>
<div name="topContentElement" />
<h3>H3</h3>
</div>
);
render(
<FormPage
form={makeBypassForm(CustomPage)()}
route={{
...makeBypassRoute(CustomPage)(),
formConfig: { useCustomScrollAndFocus: true },
}}
location={location}
/>,
);

await waitFor(() => {
expect(document.activeElement.tagName).to.eq('H3');
});
});

await waitFor(() => {
expect(document.activeElement.tagName).to.eq('H3');
expect(document.activeElement.tagName).to.eq('H2');
tlei123 marked this conversation as resolved.
Show resolved Hide resolved
});
});

Expand Down