Skip to content

Commit

Permalink
feat: CopyButton avt test (#14750)
Browse files Browse the repository at this point in the history
* feat: add copybutton avt test

* Update CopyButton-test.avt.e2e.js

* Update e2e/components/CopyButton/CopyButton-test.avt.e2e.js

---------

Co-authored-by: Taylor Jones <[email protected]>
Co-authored-by: TJ Egan <[email protected]>
  • Loading branch information
3 people committed Oct 4, 2023
1 parent 3c9f1cc commit 537b28e
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions e2e/components/CopyButton/CopyButton-test.avt.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* 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';

import { expect, test } from '@playwright/test';
import { visitStory } from '../../test-utils/storybook';

test.describe('CopyButton @avt', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'CopyButton',
id: 'components-copybutton--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('CopyButton @avt-default-state');
});

test('@avt-keyboard-nav default', async ({ page }) => {
await visitStory(page, {
component: 'CopyButton',
id: 'components-copybutton--default',
globals: {
theme: 'white',
},
args: {
disabled: true,
},
});
const primaryButton = page.getByRole('button');

// Testing CopyButton
await expect(primaryButton).toBeVisible();
});
});

0 comments on commit 537b28e

Please sign in to comment.