Skip to content

Commit

Permalink
Merge branch 'main' into renovate/eslint-plugin-jest-27.x
Browse files Browse the repository at this point in the history
  • Loading branch information
guidari authored Jul 14, 2023
2 parents ed45335 + a410069 commit 7b8eced
Show file tree
Hide file tree
Showing 92 changed files with 1,498 additions and 415 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-react-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v2
with:
path: 'packages/react/storybook-static'

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
312 changes: 156 additions & 156 deletions .yarn/releases/yarn-3.6.0.cjs → .yarn/releases/yarn-3.6.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

yarn-path ".yarn/releases/yarn-3.5.0.cjs"
yarn-path ".yarn/releases/yarn-3.6.1.cjs"
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ supportedArchitectures:
- linux
- win32

yarnPath: .yarn/releases/yarn-3.6.0.cjs
yarnPath: .yarn/releases/yarn-3.6.1.cjs
2 changes: 1 addition & 1 deletion achecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
const path = require('path');

module.exports = {
ruleArchive: '26May2023',
ruleArchive: 'latest',
policies: ['Custom_Ruleset'],
failLevels: ['violation'],
reportLevels: [
Expand Down
141 changes: 141 additions & 0 deletions e2e/components/ProgressIndicator/ProgressIndicator-test.avt.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
/**
* 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('ProgressIndicator', () => {
test('accessibility-checker @avt', async ({ page }) => {
await visitStory(page, {
component: 'ProgressIndicator',
id: 'components-progressindicator--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('ProgressIndicator');
});

test('accessibility-checker interactive progressindicator @avt', async ({
page,
}) => {
await visitStory(page, {
component: 'ProgressIndicator',
id: 'components-progressindicator--interactive',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('ProgressIndicator-interactive');
});

test('accessibility-checker skeleton progressindicator @avt', async ({
page,
}) => {
await visitStory(page, {
component: 'ProgressIndicator',
id: 'components-progressindicator--skeleton',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('ProgressIndicator-skeleton');
});

test('accessibility-checker - onHover @avt', async ({ page }) => {
await visitStory(page, {
component: 'ProgressIndicator',
id: 'components-progressindicator--default',
globals: {
theme: 'white',
},
});

await expect(page.getByText('First step')).toBeVisible();

page.getByText('First step').hover();

await expect(page).toHaveNoACViolations('ProgressIndicator-onhover');
});

test('accessibility-checker - complete @avt', async ({ page }) => {
await visitStory(page, {
component: 'ProgressIndicator',
id: 'components-progressindicator--default',
globals: {
theme: 'white',
},
});

// Checking if the 'complete' prop is adding the correct class
expect(page.locator('.cds--progress-step--complete')).toBeTruthy();
});

test('accessibility-checker - current @avt', async ({ page }) => {
await visitStory(page, {
component: 'ProgressIndicator',
id: 'components-progressindicator--default',
globals: {
theme: 'white',
},
});

// Checking if the 'current' prop is adding the correct class
expect(page.locator('.cds--progress-step--current')).toBeTruthy();
});

test('accessibility-checker - interactive onHover @avt', async ({ page }) => {
await visitStory(page, {
component: 'ProgressIndicator',
id: 'components-progressindicator--interactive',
globals: {
theme: 'white',
},
});

await expect(page.getByText('Click me')).toBeVisible();

page.getByText('Click me').hover();

await expect(page).toHaveNoACViolations(
'ProgressIndicator-interactive-onhover'
);
});

test('progress indicator - keyboard nav', async ({ page }) => {
await visitStory(page, {
component: 'ProgressIndicator',
id: 'components-progressindicator--interactive',
globals: {
theme: 'white',
},
});
// Testing the first element interaction
await page.keyboard.press('Tab');
await expect(page.getByRole('button', { name: 'Click me' })).toBeVisible();
await page.keyboard.press('Tab');
await expect(page.getByRole('button', { name: 'Click me' })).toBeFocused();

await page.keyboard.press('Enter');
await page.keyboard.press('Escape');

// Testing the third element interaction
await page.keyboard.press('Tab');
await expect(
page.getByRole('button', { name: 'Third step' })
).toBeFocused();

await page.keyboard.press('Enter');
await page.keyboard.press('Escape');

await expect(
page.getByRole('button', { name: 'Third step' })
).toBeFocused();
});
});
15 changes: 2 additions & 13 deletions e2e/components/ProgressIndicator/ProgressIndicator-test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('ProgressIndicator', () => {
themes.forEach((theme) => {
Expand All @@ -31,15 +31,4 @@ test.describe('ProgressIndicator', () => {
});
});
});

test('accessibility-checker @avt', async ({ page }) => {
await visitStory(page, {
component: 'ProgressIndicator',
id: 'components-progressindicator--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('ProgressIndicator');
});
});
40 changes: 40 additions & 0 deletions e2e/components/TextInput/TextInput-test.avt.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* 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('TextInput @avt', () => {
test('default state', async ({ page }) => {
await visitStory(page, {
component: 'TextInput',
id: 'components-textinput--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('TextInput');
});

test('disabled state', async ({ page }) => {
await visitStory(page, {
component: 'TextInput',
id: 'components-textinput--playground',
globals: {
theme: 'white',
},
args: {
disabled: 'true',
},
});

await expect(page.getByRole('textbox')).toBeDisabled();
await expect(page).toHaveNoACViolations('TextInput-Disabled');
});
});
15 changes: 2 additions & 13 deletions e2e/components/TextInput/TextInput-test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('TextInput', () => {
themes.forEach((theme) => {
Expand Down Expand Up @@ -55,15 +55,4 @@ test.describe('TextInput', () => {
});
});
});

test('accessibility-checker @avt', async ({ page }) => {
await visitStory(page, {
component: 'TextInput',
id: 'components-textinput--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('TextInput');
});
});
11 changes: 10 additions & 1 deletion e2e/test-utils/storybook.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@
const { snapshot } = require('./snapshot');

async function visitStory(page, options) {
const { component, story, id, globals } = options;
const { component, story, id, globals, args } = options;
let url = getStoryUrl({
component,
story,
id,
});

if (args) {
const values = Object.entries(args)
.map(([key, value]) => {
return `${key}:${value}`;
})
.join(';');
url = url + `&args=${values}`;
}

if (globals) {
const values = Object.entries(globals)
.map(([key, value]) => {
Expand Down
19 changes: 15 additions & 4 deletions examples/class-prefix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,26 @@ component.

## Getting Started

First, run `yarn` or `npm install` and then run the development server:
First, run `yarn build` in the root of the `carbon` repository.

```bash
npm run dev
```sh
yarn install && yarn build
```

Now, all you need to do is `cd` into the directory and run:

```sh
yarn install
# or
npm install


yarn dev
# or
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the
Open [http://localhost:5173](http://localhost:5173) with your browser to see the
result.

## Sass
Expand Down
23 changes: 23 additions & 0 deletions examples/codesandbox-styles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Getting Started with Code Sandbox styles

First, run `yarn build` in the root of the `carbon` repository.

```sh
yarn install && yarn build
```

Now, all you need to do is `cd` into the directory and run:

```sh
yarn install
# or
npm install


yarn dev
# or
npm run dev
```

Open [http://localhost:5173](http://localhost:5173) with your browser to see the
result.
11 changes: 7 additions & 4 deletions examples/codesandbox-with-sass-compilation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
First, run `yarn build` in the root of the `carbon` repository.

The page will reload when you make changes.\
You may also see any lint errors in the console.
```sh
yarn install && yarn build
```

Now to run this example, all you need to do is `cd` into the directory, run
`yarn install`, and then `yarn start`.

### `npm test`

Expand Down
13 changes: 8 additions & 5 deletions examples/codesandbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ This project was bootstrapped with

In the project directory, you can run:

### `npm start`
### Usage

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
First, run `yarn build` in the root of the `carbon` repository.

The page will reload when you make changes.\
You may also see any lint errors in the console.
```sh
yarn install && yarn build
```

Now to run this example, all you need to do is `cd` into the directory, run
`yarn install`, and then `yarn start`.

### `npm test`

Expand Down
Loading

0 comments on commit 7b8eced

Please sign in to comment.