Skip to content

Commit

Permalink
Update CSS selector name in test helper (#236)
Browse files Browse the repository at this point in the history
* chore: Updated class name

* chore: Updated test assertions

---------

Co-authored-by: ijlee2 <ijlee2@users.noreply.github.com>
  • Loading branch information
ijlee2 and ijlee2 authored Jun 12, 2024
1 parent a0b656b commit 5abe585
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions docs-app/tests/acceptance/album/visual-regression-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,17 @@ module('Acceptance | album', function (hooks) {

test('@w3 @h1 Visual snapshot', async function (assert) {
assert
.dom('[data-test-table="Tracks"]')
.exists('We see the album tracks in a table.');

assert
.dom('[data-test-table="Tracks"] [data-test-row]')
.exists({ count: 11 }, 'We see 11 tracks.');
.dom('[data-test-list="Tracks"]')
.exists('We see the album tracks in a list.')
.hasAttribute(
'data-css-grid',
'4 x 3',
'We see 11 tracks in a 4 x 3 grid.',
);

assert
.dom('[data-test-track-lyrics]')
.exists("We see the current track's lyrics.");
.doesNotExist("We don't see the current track's lyrics.");

await takeSnapshot(assert);
});
Expand Down
4 changes: 2 additions & 2 deletions docs-app/tests/helpers/reset-viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
Do not allow ember-qunit to resize the viewport! Resizing the viewport causes
issues with tests and Percy snapshots for this addon.
https://github.com/emberjs/ember-qunit/blob/master/vendor/ember-qunit/test-container-styles.css
https://github.com/emberjs/ember-qunit/blob/v8.1.0/addon/src/test-container-styles.css#L33
*/
export function resetViewport(hooks: NestedHooks): void {
hooks.beforeEach(function () {
const testingContainer = document.getElementById(
'ember-testing-container',
)!;

testingContainer.classList.add('full-screen');
testingContainer.classList.add('ember-testing-container-full-screen');
});
}

0 comments on commit 5abe585

Please sign in to comment.