-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(fileuploader): cover complex states with avt (#14527)
* test(fileuploader): cover complex states with avt * chore: cleanup comments
- Loading branch information
1 parent
78472c6
commit 2d0deed
Showing
3 changed files
with
148 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/** | ||
* 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'); | ||
const path = require('path'); | ||
|
||
test.describe('FileUploader @avt', () => { | ||
test('accessibility-checker default state', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'FileUploader', | ||
id: 'components-fileuploader--default', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('FileUploader default state'); | ||
}); | ||
test('accessibility-checker default state with upload', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'FileUploader', | ||
id: 'components-fileuploader--playground', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await page | ||
.getByLabel('Add file') | ||
.setInputFiles(path.join(__dirname, 'test-file-for-uploading.png')); | ||
await expect(page).toHaveNoACViolations( | ||
'FileUploader default state with upload' | ||
); | ||
}); | ||
test('accessibility-checker invalid state', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'FileUploader', | ||
id: 'components-fileuploader--file-uploader-item', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
args: { | ||
invalid: true, | ||
}, | ||
}); | ||
|
||
await expect(page).toHaveNoACViolations('FileUploader invalid state'); | ||
}); | ||
|
||
test('accessibility-checker complete state', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'FileUploader', | ||
id: 'components-fileuploader--file-uploader-item', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
args: { | ||
status: 'complete', | ||
}, | ||
}); | ||
|
||
await expect(page).toHaveNoACViolations('FileUploader complete state'); | ||
}); | ||
|
||
test('accessibility-checker uploading state', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'FileUploader', | ||
id: 'components-fileuploader--file-uploader-item', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
args: { | ||
status: 'uploading', | ||
}, | ||
}); | ||
|
||
await expect(page).toHaveNoACViolations('FileUploader uploading state'); | ||
}); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters