From bf87abef19743b300de001c18e2d4963829d6274 Mon Sep 17 00:00:00 2001 From: TJ Egan Date: Wed, 2 Aug 2023 12:59:18 -0400 Subject: [PATCH 1/3] test(Link): add @avt tests (#14362) --- e2e/components/Link/Link-test.avt.e2e.js | 48 ++++++++++++++++++++++++ e2e/components/Link/Link-test.e2e.js | 15 +------- 2 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 e2e/components/Link/Link-test.avt.e2e.js diff --git a/e2e/components/Link/Link-test.avt.e2e.js b/e2e/components/Link/Link-test.avt.e2e.js new file mode 100644 index 000000000000..6284414bbd1d --- /dev/null +++ b/e2e/components/Link/Link-test.avt.e2e.js @@ -0,0 +1,48 @@ +/** + * Copyright IBM Corp. 2016, 2023 + * + * This source code is licensed under the Apache-2.0 license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +const { expect, test } = require('@playwright/test'); +const { visitStory } = require('../../test-utils/storybook'); + +test.describe('Link @avt', () => { + test('accessibility-checker default', async ({ page }) => { + await visitStory(page, { + component: 'Link', + id: 'components-link--default', + globals: { + theme: 'white', + }, + }); + await expect(page).toHaveNoACViolations('components-link--default'); + }); + + test('accessibility-checker inline', async ({ page }) => { + await visitStory(page, { + component: 'Link', + id: 'components-link--inline', + globals: { + theme: 'white', + }, + }); + await expect(page).toHaveNoACViolations('components-link--inline'); + }); + + test('accessibility-checker paired with icon', async ({ page }) => { + await visitStory(page, { + component: 'Link', + id: 'components-link--paired-with-icon', + globals: { + theme: 'white', + }, + }); + await expect(page).toHaveNoACViolations( + 'components-link--paired-with-icon' + ); + }); +}); diff --git a/e2e/components/Link/Link-test.e2e.js b/e2e/components/Link/Link-test.e2e.js index a6ca4b8a2c41..b420f77315cc 100644 --- a/e2e/components/Link/Link-test.e2e.js +++ b/e2e/components/Link/Link-test.e2e.js @@ -7,9 +7,9 @@ 'use strict'; -const { expect, test } = require('@playwright/test'); +const { test } = require('@playwright/test'); const { themes } = require('../../test-utils/env'); -const { snapshotStory, visitStory } = require('../../test-utils/storybook'); +const { snapshotStory } = require('../../test-utils/storybook'); test.describe('Link', () => { themes.forEach((theme) => { @@ -31,15 +31,4 @@ test.describe('Link', () => { }); }); }); - - test('accessibility-checker @avt', async ({ page }) => { - await visitStory(page, { - component: 'Link', - id: 'components-link--default', - globals: { - theme: 'white', - }, - }); - await expect(page).toHaveNoACViolations('Link'); - }); }); From 22c934941dfd858f42d989c5610963286ab672d9 Mon Sep 17 00:00:00 2001 From: TJ Egan Date: Wed, 2 Aug 2023 13:25:18 -0400 Subject: [PATCH 2/3] style(Type): fix old variable usage (#14365) * style(Type): fix old variable usage * test(Type): update snapshots --- .../styles/scss/__tests__/__snapshots__/type-test.js.snap | 8 ++++---- packages/type/scss/_styles.scss | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/styles/scss/__tests__/__snapshots__/type-test.js.snap b/packages/styles/scss/__tests__/__snapshots__/type-test.js.snap index a27438b1dfd0..18c60de4b38b 100644 --- a/packages/styles/scss/__tests__/__snapshots__/type-test.js.snap +++ b/packages/styles/scss/__tests__/__snapshots__/type-test.js.snap @@ -933,7 +933,7 @@ Object { Object { "position": Position { "end": Object { - "column": 72, + "column": 59, "line": 96, }, "source": undefined, @@ -944,12 +944,12 @@ Object { }, "property": "font-size", "type": "declaration", - "value": "var(--cds-helper-text-02-font-size, carbon--type-scale(2))", + "value": "var(--cds-helper-text-02-font-size, 0.875rem)", }, Object { "position": Position { "end": Object { - "column": 85, + "column": 58, "line": 97, }, "source": undefined, @@ -960,7 +960,7 @@ Object { }, "property": "font-weight", "type": "declaration", - "value": "var(--cds-helper-text-02-font-weight, carbon--font-weight(\\"regular\\"))", + "value": "var(--cds-helper-text-02-font-weight, 400)", }, Object { "position": Position { diff --git a/packages/type/scss/_styles.scss b/packages/type/scss/_styles.scss index fb260c0e97da..54c62ddfa704 100644 --- a/packages/type/scss/_styles.scss +++ b/packages/type/scss/_styles.scss @@ -92,8 +92,8 @@ $helper-text-01: ( /// @deprecated /// @group @carbon/type $helper-text-02: ( - font-size: carbon--type-scale(2), - font-weight: carbon--font-weight('regular'), + font-size: scale.type-scale(2), + font-weight: font-family.font-weight('regular'), line-height: 1.28572, letter-spacing: 0.16px, ) !default; From b4a65d67097f340c70bbe07c68455258d46b27c5 Mon Sep 17 00:00:00 2001 From: TJ Egan Date: Wed, 2 Aug 2023 13:26:17 -0400 Subject: [PATCH 3/3] test(List): add @avt tests (#14363) Co-authored-by: Guilherme Datilio Ribeiro --- .../OrderedList/OrderedList-test.avt.e2e.js | 35 ++++++++++++++++++ .../OrderedList/OrderedList-test.e2e.js | 15 +------- .../UnorderedList-test.avt.e2e.js | 37 +++++++++++++++++++ .../UnorderedList/UnorderedList-test.e2e.js | 15 +------- 4 files changed, 76 insertions(+), 26 deletions(-) create mode 100644 e2e/components/OrderedList/OrderedList-test.avt.e2e.js create mode 100644 e2e/components/UnorderedList/UnorderedList-test.avt.e2e.js diff --git a/e2e/components/OrderedList/OrderedList-test.avt.e2e.js b/e2e/components/OrderedList/OrderedList-test.avt.e2e.js new file mode 100644 index 000000000000..15629ec67eaf --- /dev/null +++ b/e2e/components/OrderedList/OrderedList-test.avt.e2e.js @@ -0,0 +1,35 @@ +/** + * Copyright IBM Corp. 2016, 2023 + * + * This source code is licensed under the Apache-2.0 license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +const { expect, test } = require('@playwright/test'); +const { visitStory } = require('../../test-utils/storybook'); + +test.describe('OrderedList @avt', () => { + test('accessibility-checker default', async ({ page }) => { + await visitStory(page, { + component: 'OrderedList', + id: 'components-orderedlist--default', + globals: { + theme: 'white', + }, + }); + await expect(page).toHaveNoACViolations('components-orderedlist--default'); + }); + + test('accessibility-checker nested', async ({ page }) => { + await visitStory(page, { + component: 'OrderedList', + id: 'components-orderedlist--nested', + globals: { + theme: 'white', + }, + }); + await expect(page).toHaveNoACViolations('components-orderedlist--nested'); + }); +}); diff --git a/e2e/components/OrderedList/OrderedList-test.e2e.js b/e2e/components/OrderedList/OrderedList-test.e2e.js index e016b0aa8351..be32793bb9bf 100644 --- a/e2e/components/OrderedList/OrderedList-test.e2e.js +++ b/e2e/components/OrderedList/OrderedList-test.e2e.js @@ -7,9 +7,9 @@ 'use strict'; -const { expect, test } = require('@playwright/test'); +const { test } = require('@playwright/test'); const { themes } = require('../../test-utils/env'); -const { snapshotStory, visitStory } = require('../../test-utils/storybook'); +const { snapshotStory } = require('../../test-utils/storybook'); test.describe('OrderedList', () => { themes.forEach((theme) => { @@ -39,15 +39,4 @@ test.describe('OrderedList', () => { }); }); }); - - test('accessibility-checker @avt', async ({ page }) => { - await visitStory(page, { - component: 'OrderedList', - id: 'components-orderedlist--default', - globals: { - theme: 'white', - }, - }); - await expect(page).toHaveNoACViolations('OrderedList'); - }); }); diff --git a/e2e/components/UnorderedList/UnorderedList-test.avt.e2e.js b/e2e/components/UnorderedList/UnorderedList-test.avt.e2e.js new file mode 100644 index 000000000000..4d24151233c2 --- /dev/null +++ b/e2e/components/UnorderedList/UnorderedList-test.avt.e2e.js @@ -0,0 +1,37 @@ +/** + * Copyright IBM Corp. 2016, 2023 + * + * This source code is licensed under the Apache-2.0 license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +const { expect, test } = require('@playwright/test'); +const { visitStory } = require('../../test-utils/storybook'); + +test.describe('UnorderedList @avt', () => { + test('accessibility-checker default', async ({ page }) => { + await visitStory(page, { + component: 'UnorderedList', + id: 'components-unorderedlist--default', + globals: { + theme: 'white', + }, + }); + await expect(page).toHaveNoACViolations( + 'components-unorderedlist--default' + ); + }); + + test('accessibility-checker nested', async ({ page }) => { + await visitStory(page, { + component: 'UnorderedList', + id: 'components-unorderedlist--nested', + globals: { + theme: 'white', + }, + }); + await expect(page).toHaveNoACViolations('components-unorderedlist--nested'); + }); +}); diff --git a/e2e/components/UnorderedList/UnorderedList-test.e2e.js b/e2e/components/UnorderedList/UnorderedList-test.e2e.js index eaa91d3a9823..c8b5574d528b 100644 --- a/e2e/components/UnorderedList/UnorderedList-test.e2e.js +++ b/e2e/components/UnorderedList/UnorderedList-test.e2e.js @@ -7,9 +7,9 @@ 'use strict'; -const { expect, test } = require('@playwright/test'); +const { test } = require('@playwright/test'); const { themes } = require('../../test-utils/env'); -const { snapshotStory, visitStory } = require('../../test-utils/storybook'); +const { snapshotStory } = require('../../test-utils/storybook'); test.describe('UnorderedList', () => { themes.forEach((theme) => { @@ -31,15 +31,4 @@ test.describe('UnorderedList', () => { }); }); }); - - test('accessibility-checker @avt', async ({ page }) => { - await visitStory(page, { - component: 'UnorderedList', - id: 'components-unorderedlist--default', - globals: { - theme: 'white', - }, - }); - await expect(page).toHaveNoACViolations('UnorderedList'); - }); });