mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-08-10 07:34:18 -07:00
Adding Cypress for e2e testing (#85)
* using the higher-level react-testing-library, and regenerating snapshot - renders real DOM elements * Basic e2e testing with Cypress, following the guide here: https://www.gatsbyjs.com/docs/how-to/testing/end-to-end-testing/ ; needed to install cypress-local to avoid jest-cypress collision * Adding accessibility testing support and basic a11y tests * adding failure logging * Adding nightly test run * Fix misc stuff from lighthouse (#81) * Removing local-cypress, relying instead on a combination of type reference and eslint-plugin-cypress; adding cypress to jest ignore paths to avoid conflict - `npm test` is now jest-only, use `npm run test:e2e` to run cypress tests * updating comment to clarify timezone
This commit is contained in:
parent
7e6144c96f
commit
426f596c7a
16 changed files with 2584 additions and 890 deletions
|
@ -1,13 +1,15 @@
|
|||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import {render} from '@testing-library/react';
|
||||
import J40Footer from './J40Footer';
|
||||
import {LocalizedComponent} from '../test/testHelpers';
|
||||
|
||||
describe('J40Footer', () => {
|
||||
it('renders correctly', () => {
|
||||
const tree = renderer
|
||||
.create(<LocalizedComponent><J40Footer /></LocalizedComponent>)
|
||||
.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
const {asFragment} = render(
|
||||
<LocalizedComponent>
|
||||
<J40Footer />
|
||||
</LocalizedComponent>,
|
||||
);
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,42 +1,42 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`J40Footer renders correctly 1`] = `
|
||||
Array [
|
||||
<DocumentFragment>
|
||||
<footer
|
||||
className="usa-footer usa-footer--big"
|
||||
class="usa-footer usa-footer--big"
|
||||
>
|
||||
<div
|
||||
className="usa-footer__primary-section"
|
||||
class="usa-footer__primary-section"
|
||||
/>
|
||||
<div
|
||||
className="usa-footer__secondary-section"
|
||||
class="usa-footer__secondary-section"
|
||||
>
|
||||
<div
|
||||
className="grid-container"
|
||||
class="grid-container"
|
||||
>
|
||||
<nav
|
||||
aria-label="Footer navigation"
|
||||
className="usa-footer__nav nobreak"
|
||||
class="usa-footer__nav nobreak"
|
||||
>
|
||||
<div
|
||||
className="grid-row grid-gap-4"
|
||||
class="grid-row grid-gap-4"
|
||||
>
|
||||
<div
|
||||
className="mobile-lg:grid-col-6 desktop:grid-col-3"
|
||||
class="mobile-lg:grid-col-6 desktop:grid-col-3"
|
||||
>
|
||||
<section
|
||||
className="usa-footer__primary-content usa-footer__primary-content--collapsible"
|
||||
class="usa-footer__primary-content usa-footer__primary-content--collapsible"
|
||||
>
|
||||
<h4
|
||||
className="usa-footer__primary-link"
|
||||
class="usa-footer__primary-link"
|
||||
>
|
||||
Agency Partners
|
||||
</h4>
|
||||
<ul
|
||||
className="usa-list usa-list--unstyled"
|
||||
class="usa-list usa-list--unstyled"
|
||||
>
|
||||
<li
|
||||
className="usa-footer__secondary-link"
|
||||
class="usa-footer__secondary-link"
|
||||
>
|
||||
<a
|
||||
href="https://www.epa.gov/"
|
||||
|
@ -47,7 +47,7 @@ Array [
|
|||
</a>
|
||||
</li>
|
||||
<li
|
||||
className="usa-footer__secondary-link"
|
||||
class="usa-footer__secondary-link"
|
||||
>
|
||||
<a
|
||||
href="https://www.whitehouse.gov/omb"
|
||||
|
@ -58,7 +58,7 @@ Array [
|
|||
</a>
|
||||
</li>
|
||||
<li
|
||||
className="usa-footer__secondary-link"
|
||||
class="usa-footer__secondary-link"
|
||||
>
|
||||
<a
|
||||
href="https://www.energy.gov/"
|
||||
|
@ -69,7 +69,7 @@ Array [
|
|||
</a>
|
||||
</li>
|
||||
<li
|
||||
className="usa-footer__secondary-link"
|
||||
class="usa-footer__secondary-link"
|
||||
>
|
||||
<a
|
||||
href="https://www.hud.gov/"
|
||||
|
@ -83,21 +83,21 @@ Array [
|
|||
</section>
|
||||
</div>
|
||||
<div
|
||||
className="mobile-lg:grid-col-6 desktop:grid-col-3"
|
||||
class="mobile-lg:grid-col-6 desktop:grid-col-3"
|
||||
>
|
||||
<section
|
||||
className="usa-footer__primary-content usa-footer__primary-content--collapsible"
|
||||
class="usa-footer__primary-content usa-footer__primary-content--collapsible"
|
||||
>
|
||||
<h4
|
||||
className="usa-footer__primary-link"
|
||||
class="usa-footer__primary-link"
|
||||
>
|
||||
More Information
|
||||
</h4>
|
||||
<ul
|
||||
className="usa-list usa-list--unstyled"
|
||||
class="usa-list usa-list--unstyled"
|
||||
>
|
||||
<li
|
||||
className="usa-footer__secondary-link"
|
||||
class="usa-footer__secondary-link"
|
||||
>
|
||||
<a
|
||||
href="https://www.whitehouse.gov/"
|
||||
|
@ -108,7 +108,7 @@ Array [
|
|||
</a>
|
||||
</li>
|
||||
<li
|
||||
className="usa-footer__secondary-link"
|
||||
class="usa-footer__secondary-link"
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
|
@ -117,7 +117,7 @@ Array [
|
|||
</a>
|
||||
</li>
|
||||
<li
|
||||
className="usa-footer__secondary-link"
|
||||
class="usa-footer__secondary-link"
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
|
@ -129,32 +129,32 @@ Array [
|
|||
</section>
|
||||
</div>
|
||||
<div
|
||||
className="mobile-lg:grid-col-6 desktop:grid-col-3"
|
||||
class="mobile-lg:grid-col-6 desktop:grid-col-3"
|
||||
>
|
||||
<section
|
||||
className="usa-footer__primary-content usa-footer__primary-content--collapsible"
|
||||
class="usa-footer__primary-content usa-footer__primary-content--collapsible"
|
||||
>
|
||||
<h4
|
||||
className="usa-footer__primary-link"
|
||||
class="usa-footer__primary-link"
|
||||
>
|
||||
<br />
|
||||
</h4>
|
||||
<ul
|
||||
className="usa-list usa-list--unstyled"
|
||||
class="usa-list usa-list--unstyled"
|
||||
>
|
||||
<li
|
||||
className="usa-footer__secondary-link"
|
||||
class="usa-footer__secondary-link"
|
||||
>
|
||||
<div
|
||||
className="usa-footer__logo grid-row mobile-lg:grid-col-6 mobile-lg:grid-gap-2"
|
||||
class="usa-footer__logo grid-row mobile-lg:grid-col-6 mobile-lg:grid-gap-2"
|
||||
data-testid="footerLogo"
|
||||
>
|
||||
<div
|
||||
className="mobile-lg:grid-col-auto"
|
||||
class="mobile-lg:grid-col-auto"
|
||||
>
|
||||
<img
|
||||
alt="Whitehouse logo"
|
||||
className="usa-footer__logo-img"
|
||||
class="usa-footer__logo-img"
|
||||
src="test-file-stub"
|
||||
/>
|
||||
</div>
|
||||
|
@ -164,41 +164,41 @@ Array [
|
|||
</section>
|
||||
</div>
|
||||
<div
|
||||
className="mobile-lg:grid-col-6 desktop:grid-col-3"
|
||||
class="mobile-lg:grid-col-6 desktop:grid-col-3"
|
||||
>
|
||||
<section
|
||||
className="usa-footer__primary-content usa-footer__primary-content--collapsible"
|
||||
class="usa-footer__primary-content usa-footer__primary-content--collapsible"
|
||||
>
|
||||
<h4
|
||||
className="usa-footer__primary-link"
|
||||
class="usa-footer__primary-link"
|
||||
>
|
||||
Council on Environmental Quality
|
||||
<br />
|
||||
</h4>
|
||||
<ul
|
||||
className="usa-list usa-list--unstyled"
|
||||
class="usa-list usa-list--unstyled"
|
||||
>
|
||||
<li
|
||||
className="usa-footer__secondary-link"
|
||||
class="usa-footer__secondary-link"
|
||||
>
|
||||
<address
|
||||
className="usa-footer__address footerAddressReadability"
|
||||
class="usa-footer__address footerAddressReadability"
|
||||
>
|
||||
<div
|
||||
className="usa-footer__contact-info grid-row grid-gap"
|
||||
class="usa-footer__contact-info grid-row grid-gap"
|
||||
>
|
||||
<div
|
||||
className=""
|
||||
class=""
|
||||
>
|
||||
730 Jackson Pl NW
|
||||
</div>
|
||||
<div
|
||||
className=""
|
||||
class=""
|
||||
>
|
||||
Washington, D.C. 20506
|
||||
</div>
|
||||
<div
|
||||
className=""
|
||||
class=""
|
||||
>
|
||||
(202) 395-5750
|
||||
</div>
|
||||
|
@ -212,7 +212,7 @@ Array [
|
|||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</footer>,
|
||||
",",
|
||||
]
|
||||
</footer>
|
||||
,
|
||||
</DocumentFragment>
|
||||
`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue