Skip to content

Commit

Permalink
uses setViewport (#4267)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlockhart authored Nov 23, 2023
1 parent fd7de37 commit ccf2211
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
12 changes: 3 additions & 9 deletions components/alert/test/alert-toast.vdiff.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { disableReducedMotionForTesting, restoreReducedMotionForTesting } from '../alert-toast.js';
import { expect, fixture, focusElem, hoverElem, html, oneEvent } from '@brightspace-ui/testing';
import { expect, fixture, focusElem, hoverElem, html, oneEvent, setViewport } from '@brightspace-ui/testing';
import sinon from 'sinon';

const alertWithSubtextAndCloseButton = html`
Expand Down Expand Up @@ -87,23 +87,17 @@ describe('alert-toast', () => {
await expect(document).to.be.golden();
});

/**
* TODO: switch to more legitimate form of resizing once available
*/
it('resize smaller', async() => {
const elem = await fixture(multipleAlerts, { viewport });
await openAlerts(elem);
await fixture(html``, { viewport: { width: 300 } });
await setViewport({ width: 300 });
await expect(document).to.be.golden();
});

/**
* TODO: switch to more legitimate form of resizing once available
*/
it('resize larger', async() => {
const elem = await fixture(multipleAlerts, { viewport: { width: 300, height: 400 } });
await openAlerts(elem);
await fixture(html``, { viewport: { width: 700 } });
await setViewport({ width: 700 });
await expect(document).to.be.golden();
});

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ccf2211

Please sign in to comment.