summaryrefslogtreecommitdiff
path: root/packages/integrations/image/test/no-alt-text-image-ssg.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/image/test/no-alt-text-image-ssg.test.js')
-rw-r--r--packages/integrations/image/test/no-alt-text-image-ssg.test.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/integrations/image/test/no-alt-text-image-ssg.test.js b/packages/integrations/image/test/no-alt-text-image-ssg.test.js
new file mode 100644
index 000000000..4c998bdb4
--- /dev/null
+++ b/packages/integrations/image/test/no-alt-text-image-ssg.test.js
@@ -0,0 +1,24 @@
+import { expect } from 'chai';
+import { loadFixture } from './test-utils.js';
+
+let fixture;
+
+const errorMessage =
+ 'The <Image> component requires you provide alt text. If this image does not require an accessible label, set alt="".';
+
+/** TODO: enable the test once missing alt text throws an error instead of a console warning */
+describe.skip('SSG image without alt text', function () {
+ before(async () => {
+ fixture = await loadFixture({ root: './fixtures/no-alt-text-image/' });
+ });
+
+ it('throws during build', async () => {
+ try {
+ await fixture.build();
+ } catch (err) {
+ expect(err.message).to.equal(errorMessage);
+ return;
+ }
+ expect.fail(0, 1, 'Exception not thrown');
+ });
+});