Skip to content

Commit

Permalink
Fix Karma test: `should allow user to edit and reset poster image usi…
Browse files Browse the repository at this point in the history
…ng keyboard` (#12157)
  • Loading branch information
miina committed Aug 23, 2022
1 parent c8f663e commit c23672d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ describe('Video Accessibility Panel', () => {
expect(vaPanel.posterImage.src).toBe(originalPoster);
});

// TODO: https://github.com/GoogleForCreators/web-stories-wp/issues/12141
// eslint-disable-next-line jasmine/no-disabled-tests
xit('should allow user to edit and reset poster image using keyboard', async () => {
it('should allow user to edit and reset poster image using keyboard', async () => {
// Remember original poster image
const originalPoster = vaPanel.posterImage.src;

Expand All @@ -99,7 +97,9 @@ describe('Video Accessibility Panel', () => {
expect(vaPanel.posterMenuEdit).toBeDefined();
await fixture.snapshot('Menu open');

// And click on edit
// The third option is for editing, press down and click to edit.
await fixture.events.keyboard.press('down');
await fixture.events.keyboard.press('down');
expect(vaPanel.posterMenuEdit).toHaveFocus();
await fixture.events.keyboard.press('Enter');

Expand All @@ -112,6 +112,7 @@ describe('Video Accessibility Panel', () => {
await fixture.events.keyboard.press('Enter');
await fixture.events.keyboard.press('down');
await fixture.events.keyboard.press('down');
await fixture.events.keyboard.press('down');
expect(vaPanel.posterMenuReset).toHaveFocus();
await fixture.events.keyboard.press('Enter');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class VideoPoster extends AbstractPanel {

get posterMenuEdit() {
return this.getByRoleIn(this.node.ownerDocument, 'menuitem', {
name: /upload a file/i,
name: /edit/i,
});
}

Expand Down

0 comments on commit c23672d

Please sign in to comment.