Skip to content

Commit

Permalink
correct test
Browse files Browse the repository at this point in the history
  • Loading branch information
nielslyngsoe committed Nov 18, 2024
1 parent f68d009 commit 6b227bc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/uui-card-block-type/lib/uui-card-block-type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('UUICardBlockTypeElement', () => {
element.selectable = true;
await elementUpdated(element);
const listener = oneEvent(element, UUISelectableEvent.SELECTED);
element.dispatchEvent(new KeyboardEvent('keypress', { key: 'Enter' }));
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
const event = await listener;
expect(event).to.exist;
expect(event.type).to.equal(UUISelectableEvent.SELECTED);
Expand All @@ -115,7 +115,7 @@ describe('UUICardBlockTypeElement', () => {
element,
UUISelectableEvent.DESELECTED,
);
element.dispatchEvent(new KeyboardEvent('keypress', { key: 'Enter' }));
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
const event2 = await unselectedListener;
expect(event2).to.exist;
expect(event2.type).to.equal(UUISelectableEvent.DESELECTED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('UUICardContentNodeElement', () => {
element.selectable = true;
await elementUpdated(element);
const listener = oneEvent(element, UUISelectableEvent.SELECTED);
element.dispatchEvent(new KeyboardEvent('keypress', { key: 'Enter' }));
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
const event = await listener;
expect(event).to.exist;
expect(event.type).to.equal(UUISelectableEvent.SELECTED);
Expand All @@ -121,7 +121,7 @@ describe('UUICardContentNodeElement', () => {
element,
UUISelectableEvent.DESELECTED,
);
element.dispatchEvent(new KeyboardEvent('keypress', { key: 'Enter' }));
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
const event2 = await unselectedListener;
expect(event2).to.exist;
expect(event2.type).to.equal(UUISelectableEvent.DESELECTED);
Expand Down
4 changes: 2 additions & 2 deletions packages/uui-card-media/lib/uui-card-media.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('UUICardMediaElement', () => {
element.selectable = true;
await elementUpdated(element);
const listener = oneEvent(element, UUISelectableEvent.SELECTED);
element.dispatchEvent(new KeyboardEvent('keypress', { key: 'Enter' }));
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
const event = await listener;
expect(event).to.exist;
expect(event.type).to.equal(UUISelectableEvent.SELECTED);
Expand All @@ -113,7 +113,7 @@ describe('UUICardMediaElement', () => {
element,
UUISelectableEvent.DESELECTED,
);
element.dispatchEvent(new KeyboardEvent('keypress', { key: 'Enter' }));
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
const event2 = await unselectedListener;
expect(event2).to.exist;
expect(event2.type).to.equal(UUISelectableEvent.DESELECTED);
Expand Down
4 changes: 2 additions & 2 deletions packages/uui-card-user/lib/uui-card-user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('UUICardUserElement', () => {
await elementUpdated(element);

const listener = oneEvent(element, UUISelectableEvent.SELECTED);
element.dispatchEvent(new KeyboardEvent('keypress', { key: 'Enter' }));
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
const event = await listener;
expect(event).to.exist;
expect(event.type).to.equal(UUISelectableEvent.SELECTED);
Expand All @@ -114,7 +114,7 @@ describe('UUICardUserElement', () => {
element,
UUISelectableEvent.DESELECTED,
);
element.dispatchEvent(new KeyboardEvent('keypress', { key: 'Enter' }));
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
const event2 = await unselectedListener;
expect(event2).to.exist;
expect(event2.type).to.equal(UUISelectableEvent.DESELECTED);
Expand Down

0 comments on commit 6b227bc

Please sign in to comment.