From 5abe58550a8229800b6c6efee6ad4a167eea7daa Mon Sep 17 00:00:00 2001 From: Isaac Lee <16869656+ijlee2@users.noreply.github.com> Date: Wed, 12 Jun 2024 08:44:25 +0200 Subject: [PATCH] Update CSS selector name in test helper (#236) * chore: Updated class name * chore: Updated test assertions --------- Co-authored-by: ijlee2 --- .../acceptance/album/visual-regression-test.ts | 15 ++++++++------- docs-app/tests/helpers/reset-viewport.ts | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs-app/tests/acceptance/album/visual-regression-test.ts b/docs-app/tests/acceptance/album/visual-regression-test.ts index 648182fc..b94dc092 100644 --- a/docs-app/tests/acceptance/album/visual-regression-test.ts +++ b/docs-app/tests/acceptance/album/visual-regression-test.ts @@ -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); }); diff --git a/docs-app/tests/helpers/reset-viewport.ts b/docs-app/tests/helpers/reset-viewport.ts index 1fbe9f99..f7aef3d2 100644 --- a/docs-app/tests/helpers/reset-viewport.ts +++ b/docs-app/tests/helpers/reset-viewport.ts @@ -2,7 +2,7 @@ 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 () { @@ -10,6 +10,6 @@ export function resetViewport(hooks: NestedHooks): void { 'ember-testing-container', )!; - testingContainer.classList.add('full-screen'); + testingContainer.classList.add('ember-testing-container-full-screen'); }); }