Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
xandervedder committed Sep 27, 2024
1 parent 0bf168c commit d63e71e
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ describe(MutationTestReportFilePickerComponent.name, () => {

it('should close the picker when clicking outside the dialog', async () => {
// Act
(sut.element.shadowRoot?.querySelector('#backdrop') as HTMLElement)?.click();
const backdrop = sut.element.shadowRoot?.querySelector('#backdrop');
(backdrop as HTMLElement).click();
await sut.whenStable();

// Assert
Expand All @@ -91,11 +92,11 @@ describe(MutationTestReportFilePickerComponent.name, () => {
describe('when typing in the search box', () => {
it('should select the first item when searching with the letter "i"', async () => {
// Arrange
const input = sut.element.shadowRoot?.querySelector('#file-picker-input') as HTMLInputElement;
const input = sut.element.shadowRoot?.querySelector('#file-picker-input');

// Act
input.value = 'i';
input.dispatchEvent(new KeyboardEvent('keydown', { key: 'i' }));
(input as HTMLInputElement).value = 'i';
input?.dispatchEvent(new KeyboardEvent('keydown', { key: 'i' }));
input?.dispatchEvent(new KeyboardEvent('keyup', { key: 'i' }));
await sut.whenStable();

Expand All @@ -105,9 +106,9 @@ describe(MutationTestReportFilePickerComponent.name, () => {

it('should redirect to mutant when pressing enter', async () => {
// Arrange
const input = sut.element.shadowRoot?.querySelector('#file-picker-input') as HTMLInputElement;
input.value = 'index.html';
input.dispatchEvent(new KeyboardEvent('keydown', { key: 'l' }));
const input = sut.element.shadowRoot?.querySelector('#file-picker-input');
(input as HTMLInputElement).value = 'index.html';
input?.dispatchEvent(new KeyboardEvent('keydown', { key: 'l' }));
input?.dispatchEvent(new KeyboardEvent('keyup', { key: 'l' }));
await sut.whenStable();

Expand All @@ -121,8 +122,9 @@ describe(MutationTestReportFilePickerComponent.name, () => {
});

describe('when pressing the arrow keys', () => {
beforeEach(async () => {
(sut.element.shadowRoot?.querySelector('#file-picker-input') as HTMLInputElement).value = '';
beforeEach(() => {
const input = sut.element.shadowRoot?.querySelector('#file-picker-input');
(input as HTMLInputElement).value = '';
});

it('should move active item to the next item when pressing down', async () => {
Expand Down

0 comments on commit d63e71e

Please sign in to comment.