From b0cbe76e680d3500c83915158ad934188aa55519 Mon Sep 17 00:00:00 2001 From: Margaree Peacocke Date: Thu, 19 Sep 2024 13:44:00 -0400 Subject: [PATCH] Dialogs: Add axe tests --- components/dialog/test/dialog-confirm.axe.js | 37 ++++++++++++++ .../dialog/test/dialog-fullscreen.axe.js | 44 +++++++++++++++++ components/dialog/test/dialog.axe.js | 49 +++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 components/dialog/test/dialog-confirm.axe.js create mode 100644 components/dialog/test/dialog-fullscreen.axe.js create mode 100644 components/dialog/test/dialog.axe.js diff --git a/components/dialog/test/dialog-confirm.axe.js b/components/dialog/test/dialog-confirm.axe.js new file mode 100644 index 0000000000..aabcaaa1bf --- /dev/null +++ b/components/dialog/test/dialog-confirm.axe.js @@ -0,0 +1,37 @@ +import '../dialog-confirm.js'; +import '../../button/button.js'; +import { expect, fixture, html } from '@brightspace-ui/testing'; + +describe('d2l-dialog-confirm', () => { + + it('closed', async() => { + const el = await fixture(html``); + await expect(el).to.be.accessible(); + }); + + it('default with title-text', async() => { + const el = await fixture(html``); + await expect(el).to.be.accessible(); + }); + + it('critical', async() => { + const el = await fixture(html``); + await expect(el).to.be.accessible(); + }); + + it('footer buttons', async() => { + const el = await fixture(html` + + Done + Cancel + + `); + await expect(el).to.be.accessible(); + }); + + it('no title-text', async() => { + const el = await fixture(html``); + await expect(el).to.be.accessible(); + }); + +}); diff --git a/components/dialog/test/dialog-fullscreen.axe.js b/components/dialog/test/dialog-fullscreen.axe.js new file mode 100644 index 0000000000..1cd7867840 --- /dev/null +++ b/components/dialog/test/dialog-fullscreen.axe.js @@ -0,0 +1,44 @@ +import '../dialog-fullscreen.js'; +import '../../button/button.js'; +import { expect, fixture, html } from '@brightspace-ui/testing'; + +describe('d2l-dialog-fullscreen', () => { + + it('closed', async() => { + const el = await fixture(html``); + await expect(el).to.be.accessible(); + }); + + it('default with title-text', async() => { + const el = await fixture(html``); + await expect(el).to.be.accessible(); + }); + + it('footer buttons', async() => { + const el = await fixture(html` + +
Some dialog content
+ Done + Cancel +
+ `); + await expect(el).to.be.accessible(); + }); + + it.skip('no title-text', async() => { + const el = await fixture(html`My content`); + await expect(el).to.be.accessible(); + }); + + it.skip('tall content', async() => { + const el = await fixture(html` + +
+
My content
+
+
+ `); + await expect(el).to.be.accessible(); + }); + +}); diff --git a/components/dialog/test/dialog.axe.js b/components/dialog/test/dialog.axe.js new file mode 100644 index 0000000000..30e4918ca4 --- /dev/null +++ b/components/dialog/test/dialog.axe.js @@ -0,0 +1,49 @@ +import '../dialog.js'; +import '../../button/button.js'; +import { expect, fixture, html } from '@brightspace-ui/testing'; + +describe('d2l-dialog', () => { + + it('closed', async() => { + const el = await fixture(html``); + await expect(el).to.be.accessible(); + }); + + it('default with title-text', async() => { + const el = await fixture(html``); + await expect(el).to.be.accessible(); + }); + + it('describe-content', async() => { + const el = await fixture(html`My content`); + await expect(el).to.be.accessible(); + }); + + it('footer buttons', async() => { + const el = await fixture(html` + +
Some dialog content
+ Done + Cancel +
+ `); + await expect(el).to.be.accessible(); + }); + + it.skip('no title-text', async() => { + const el = await fixture(html`My content`); + await expect(el).to.be.accessible(); + }); + + it.skip('tall content', async() => { + const el = await fixture(html` + +
+
My content
+
+
+ `); + await expect(el).to.be.accessible(); + }); + +});