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

Add snapshot unit tests #68

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ If you are noticing that the jest tests are taking a long time, you might want t

> Hint: Make sure the local server is running first using the `npm run start` command.

In order to update all of the failing unit test snapshots, run `npm run jest-update-snapshots`. If you only want to update the snapshots for a specific unit test file, run `npm run jest-update-snapshots -- -u`

#### Chromedriver issues

Your version of Chrome needs to match the `chromedriver` package version. You can find your version of Chrome (ie. 121.x.xxxx.xxx) by checking the version number inside the "About Chrome" dialog in Chrome.
Expand Down
1,849 changes: 1,849 additions & 0 deletions js/test/__snapshots__/accessible-text-svg.test.js.snap

Large diffs are not rendered by default.

1,783 changes: 1,783 additions & 0 deletions js/test/__snapshots__/acknowledgements.test.js.snap

Large diffs are not rendered by default.

1,705 changes: 1,705 additions & 0 deletions js/test/__snapshots__/alert-dialog.test.js.snap

Large diffs are not rendered by default.

1,786 changes: 1,786 additions & 0 deletions js/test/__snapshots__/alert.test.js.snap

Large diffs are not rendered by default.

1,997 changes: 1,997 additions & 0 deletions js/test/__snapshots__/animated-gif-with-pause-button.test.js.snap

Large diffs are not rendered by default.

1,747 changes: 1,747 additions & 0 deletions js/test/__snapshots__/animated-hide-show.test.js.snap

Large diffs are not rendered by default.

1,783 changes: 1,783 additions & 0 deletions js/test/__snapshots__/bookmarklets.test.js.snap

Large diffs are not rendered by default.

1,804 changes: 1,804 additions & 0 deletions js/test/__snapshots__/bottom-fixed-navigation.test.js.snap

Large diffs are not rendered by default.

2,063 changes: 2,063 additions & 0 deletions js/test/__snapshots__/button.test.js.snap

Large diffs are not rendered by default.

2,392 changes: 2,392 additions & 0 deletions js/test/__snapshots__/carousel.test.js.snap

Large diffs are not rendered by default.

1,887 changes: 1,887 additions & 0 deletions js/test/__snapshots__/chart.test.js.snap

Large diffs are not rendered by default.

2,538 changes: 2,538 additions & 0 deletions js/test/__snapshots__/checkbox.test.js.snap

Large diffs are not rendered by default.

2,487 changes: 2,487 additions & 0 deletions js/test/__snapshots__/code-quality.test.js.snap

Large diffs are not rendered by default.

2,946 changes: 2,946 additions & 0 deletions js/test/__snapshots__/combobox.test.js.snap

Large diffs are not rendered by default.

1,713 changes: 1,713 additions & 0 deletions js/test/__snapshots__/date.test.js.snap

Large diffs are not rendered by default.

1,868 changes: 1,868 additions & 0 deletions js/test/__snapshots__/description-list.test.js.snap

Large diffs are not rendered by default.

2,088 changes: 2,088 additions & 0 deletions js/test/__snapshots__/dialog.test.js.snap

Large diffs are not rendered by default.

2,458 changes: 2,458 additions & 0 deletions js/test/__snapshots__/dropdown.test.js.snap

Large diffs are not rendered by default.

1,891 changes: 1,891 additions & 0 deletions js/test/__snapshots__/exposing-style-info-to-screen-readers.test.js.snap

Large diffs are not rendered by default.

1,694 changes: 1,694 additions & 0 deletions js/test/__snapshots__/faq.test.js.snap

Large diffs are not rendered by default.

1,863 changes: 1,863 additions & 0 deletions js/test/__snapshots__/figure.test.js.snap

Large diffs are not rendered by default.

2,301 changes: 2,301 additions & 0 deletions js/test/__snapshots__/focus-styling.test.js.snap

Large diffs are not rendered by default.

2,276 changes: 2,276 additions & 0 deletions js/test/__snapshots__/form-error-checking.test.js.snap

Large diffs are not rendered by default.

1,937 changes: 1,937 additions & 0 deletions js/test/__snapshots__/form.test.js.snap

Large diffs are not rendered by default.

1,878 changes: 1,878 additions & 0 deletions js/test/__snapshots__/heading.test.js.snap

Large diffs are not rendered by default.

2,134 changes: 2,134 additions & 0 deletions js/test/__snapshots__/hero-image-text-resize.test.js.snap

Large diffs are not rendered by default.

2,818 changes: 2,818 additions & 0 deletions js/test/__snapshots__/img.test.js.snap

Large diffs are not rendered by default.

1,788 changes: 1,788 additions & 0 deletions js/test/__snapshots__/index.test.js.snap

Large diffs are not rendered by default.

2,444 changes: 2,444 additions & 0 deletions js/test/__snapshots__/input-mask.test.js.snap

Large diffs are not rendered by default.

2,153 changes: 2,153 additions & 0 deletions js/test/__snapshots__/link.test.js.snap

Large diffs are not rendered by default.

2,475 changes: 2,475 additions & 0 deletions js/test/__snapshots__/listbox.test.js.snap

Large diffs are not rendered by default.

1,783 changes: 1,783 additions & 0 deletions js/test/__snapshots__/log.test.js.snap

Large diffs are not rendered by default.

1,774 changes: 1,774 additions & 0 deletions js/test/__snapshots__/marquee.test.js.snap

Large diffs are not rendered by default.

1,927 changes: 1,927 additions & 0 deletions js/test/__snapshots__/math.test.js.snap

Large diffs are not rendered by default.

1,792 changes: 1,792 additions & 0 deletions js/test/__snapshots__/npm.test.js.snap

Large diffs are not rendered by default.

3,836 changes: 3,836 additions & 0 deletions js/test/__snapshots__/pagination-table.test.js.snap

Large diffs are not rendered by default.

2,869 changes: 2,869 additions & 0 deletions js/test/__snapshots__/pause-anim-control.test.js.snap

Large diffs are not rendered by default.

2,093 changes: 2,093 additions & 0 deletions js/test/__snapshots__/progress.test.js.snap

Large diffs are not rendered by default.

2,198 changes: 2,198 additions & 0 deletions js/test/__snapshots__/radiogroup.test.js.snap

Large diffs are not rendered by default.

1,871 changes: 1,871 additions & 0 deletions js/test/__snapshots__/reflow.test.js.snap

Large diffs are not rendered by default.

1,807 changes: 1,807 additions & 0 deletions js/test/__snapshots__/screen-reader-only-text.test.js.snap

Large diffs are not rendered by default.

1,746 changes: 1,746 additions & 0 deletions js/test/__snapshots__/search.test.js.snap

Large diffs are not rendered by default.

2,641 changes: 2,641 additions & 0 deletions js/test/__snapshots__/skip-link.test.js.snap

Large diffs are not rendered by default.

2,772 changes: 2,772 additions & 0 deletions js/test/__snapshots__/slider.test.js.snap

Large diffs are not rendered by default.

3,473 changes: 3,473 additions & 0 deletions js/test/__snapshots__/sortable-pagination-table.test.js.snap

Large diffs are not rendered by default.

2,116 changes: 2,116 additions & 0 deletions js/test/__snapshots__/sortable-table.test.js.snap

Large diffs are not rendered by default.

2,297 changes: 2,297 additions & 0 deletions js/test/__snapshots__/spinner.test.js.snap

Large diffs are not rendered by default.

1,785 changes: 1,785 additions & 0 deletions js/test/__snapshots__/status.test.js.snap

Large diffs are not rendered by default.

2,067 changes: 2,067 additions & 0 deletions js/test/__snapshots__/switch.test.js.snap

Large diffs are not rendered by default.

4,268 changes: 4,268 additions & 0 deletions js/test/__snapshots__/table.test.js.snap

Large diffs are not rendered by default.

2,211 changes: 2,211 additions & 0 deletions js/test/__snapshots__/tabs.test.js.snap

Large diffs are not rendered by default.

1,772 changes: 1,772 additions & 0 deletions js/test/__snapshots__/text-contrast.test.js.snap

Large diffs are not rendered by default.

2,100 changes: 2,100 additions & 0 deletions js/test/__snapshots__/text-resize.test.js.snap

Large diffs are not rendered by default.

1,694 changes: 1,694 additions & 0 deletions js/test/__snapshots__/text-spacing.test.js.snap

Large diffs are not rendered by default.

2,245 changes: 2,245 additions & 0 deletions js/test/__snapshots__/textbox.test.js.snap

Large diffs are not rendered by default.

1,799 changes: 1,799 additions & 0 deletions js/test/__snapshots__/timer.test.js.snap

Large diffs are not rendered by default.

2,166 changes: 2,166 additions & 0 deletions js/test/__snapshots__/tooltip.test.js.snap

Large diffs are not rendered by default.

1,914 changes: 1,914 additions & 0 deletions js/test/__snapshots__/video-content.test.js.snap

Large diffs are not rendered by default.

2,246 changes: 2,246 additions & 0 deletions js/test/__snapshots__/video-player.test.js.snap

Large diffs are not rendered by default.

1,772 changes: 1,772 additions & 0 deletions js/test/__snapshots__/zoomable-viewport-units.test.js.snap

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions js/test/accessible-text-svg.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Accessible Text SVG Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/accessible-text-svg.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
15 changes: 15 additions & 0 deletions js/test/acknowledgements.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Acknowledgements Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/acknowledgements.php`);
await testHelpers.testPageSnapshot(page);
});
});
17 changes: 17 additions & 0 deletions js/test/alert-dialog.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Alert Dialog Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/alert-dialog.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
17 changes: 17 additions & 0 deletions js/test/alert.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Alert Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/alert.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
18 changes: 18 additions & 0 deletions js/test/animated-gif-with-pause-button.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Animated GIF with Pause Button Page Tests', () => {
beforeAll(async () => {
});

// TODO: Fix inconsistent results
it.skip('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/animated-gif-with-pause-button.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
17 changes: 17 additions & 0 deletions js/test/animated-hide-show.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Animated Hide Show Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/animated-hide-show.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
15 changes: 15 additions & 0 deletions js/test/bookmarklets.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Bookmarklets Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/bookmarklets.php`);
await testHelpers.testPageSnapshot(page);
});
});
17 changes: 17 additions & 0 deletions js/test/bottom-fixed-navigation.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Bottom Fixed Navigation Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/bottom-fixed-navigation.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
17 changes: 17 additions & 0 deletions js/test/button.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Button Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/button.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
7 changes: 6 additions & 1 deletion js/test/carousel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ describe('Carousel Tests', () => {
beforeAll(async () => {
});

// TODO: Fix inconsistent results
it.skip('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/carousel.php`);
await testHelpers.testPageSnapshot(page);
});


// Test #1
it('Test carousel type #1 (list of links)', async () => {
let domInfo;

await page.goto(`${config.BASE_URL}/carousel.php`);


// wait until all content loads
await page.waitForSelector('#example1');
Expand Down
17 changes: 17 additions & 0 deletions js/test/chart.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Chart Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/chart.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
5 changes: 5 additions & 0 deletions js/test/checkbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ describe('ARIA Checkbox Tests', () => {
}, n);
}

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/checkbox.php`);
await testHelpers.testPageSnapshot(page);
});

// Test #1
it('See if all ARIA checkboxes on page are keyboard accessible', async () => {
let ariaChecked, domInfo;
Expand Down
15 changes: 15 additions & 0 deletions js/test/code-quality.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Code Quality Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/code-quality.php`);
await testHelpers.testPageSnapshot(page);
});
});
17 changes: 17 additions & 0 deletions js/test/combobox.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Combobox Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/combobox.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
17 changes: 17 additions & 0 deletions js/test/date.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Date Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/date.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
17 changes: 17 additions & 0 deletions js/test/description-list.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Description List Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/description-list.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
5 changes: 5 additions & 0 deletions js/test/dialog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ describe('Dialog Tests', () => {
return r;

}

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/dialog.php`);
await testHelpers.testPageSnapshot(page);
});

it('Focus on open and close tests', async () => {
let domInfo;
Expand Down
17 changes: 17 additions & 0 deletions js/test/dropdown.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Dropdown Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/dropdown.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
6 changes: 6 additions & 0 deletions js/test/exposing-style-info-to-screen-readers.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';

describe('Styled Elements Tests', () => {
it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/exposing-style-info-to-screen-readers.php`);
await testHelpers.testPageSnapshot(page);
});

it('Detect if there is sr-only content in the mark tags in the visually hidden text example', async () => {
let domInfo;

Expand Down
15 changes: 15 additions & 0 deletions js/test/faq.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('FAQ Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/faq.php`);
await testHelpers.testPageSnapshot(page);
});
});
17 changes: 17 additions & 0 deletions js/test/figure.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Figure Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/figure.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
17 changes: 17 additions & 0 deletions js/test/focus-styling.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

import config from './test-config.js';
import testHelpers from './test-helpers.js';


describe('Focus Styling Page Tests', () => {
beforeAll(async () => {
});

it('Initial page load HTML matches snapshot', async () => {
await page.goto(`${config.BASE_URL}/focus-styling.php`);
await testHelpers.testPageSnapshot(page);
});

it.todo('Test functionality');
});
Loading