Skip to content

Commit

Permalink
Don’t run axe in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Oct 2, 2023
1 parent 6c9a221 commit e048967
Showing 1 changed file with 33 additions and 18 deletions.
51 changes: 33 additions & 18 deletions packages/story-editor/src/components/library/test/mediaElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,39 @@ describe('MediaElement', () => {
beforeEach(() => {
useLocalMedia.mockReturnValue(mockedReturnValue);
});
it.each`
type | resource
${'image'} | ${IMAGE_RESOURCE}
${'video'} | ${VIDEO_RESOURCE}
${'gif'} | ${GIF_RESOURCE}
`(
'should render MediaElement for a resource of type=`$type` without accessibility violations',
async ({ resource }) => {
useLocalMedia.mockReturnValue({
...mockedReturnValue,
canTranscodeResource: () => true,
});
const { container } = renderMediaElement(resource, 'local');

const results = await axe(container);
expect(results).toHaveNoViolations();
}
);

it('should render MediaElement for a resource of type=`image` without accessibility violations', async () => {
useLocalMedia.mockReturnValue({
...mockedReturnValue,
canTranscodeResource: () => true,
});
const { container } = renderMediaElement(IMAGE_RESOURCE, 'local');

const results = await axe(container);
expect(results).toHaveNoViolations();
});

it('should render MediaElement for a resource of type=`gif` without accessibility violations', async () => {
useLocalMedia.mockReturnValue({
...mockedReturnValue,
canTranscodeResource: () => true,
});
const { container } = renderMediaElement(GIF_RESOURCE, 'local');

const results = await axe(container);
expect(results).toHaveNoViolations();
});

it('should render MediaElement for a resource of type=`video` without accessibility violations', async () => {
useLocalMedia.mockReturnValue({
...mockedReturnValue,
canTranscodeResource: () => true,
});
const { container } = renderMediaElement(VIDEO_RESOURCE, 'local');

const results = await axe(container);
expect(results).toHaveNoViolations();
});

it("should render dropdown menu's more icon for uploaded image", () => {
useLocalMedia.mockReturnValue({
Expand Down

0 comments on commit e048967

Please sign in to comment.