Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dobanisola-scottlogic committed May 9, 2024
1 parent 93a6243 commit 6dc4cc7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/app/components/accordion/accordion.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ describe('Accordion', () => {
});

describe('onKeydown', () => {
let firstAccordionTabOpenEl;
let secondAccordionTabOpenEl;
let firstAccordionTabEl;
let secondAccordionTabEl;

beforeEach(() => {
firstAccordionTabOpenEl = fixture.debugElement.children[0].children[0].children[0].query(By.css('a')).nativeElement;
secondAccordionTabOpenEl = fixture.debugElement.children[0].children[0].children[1].query(By.css('a')).nativeElement;
firstAccordionTabEl = fixture.debugElement.children[0].children[0].children[0].query(By.css('a')).nativeElement;
secondAccordionTabEl = fixture.debugElement.children[0].children[0].children[1].query(By.css('a')).nativeElement;
});

const testKeyBoardEvent = (keyCode, eventTarget, activeTab) => {
Expand All @@ -217,19 +217,19 @@ describe('Accordion', () => {
};

it('ArrowDown should focus on the next tab', () => {
testKeyBoardEvent('ArrowDown', firstAccordionTabOpenEl, secondAccordionTabOpenEl);
testKeyBoardEvent('ArrowDown', firstAccordionTabEl, secondAccordionTabEl);
});

it('ArrowUp should focus on the next tab', () => {
testKeyBoardEvent('ArrowUp', secondAccordionTabOpenEl, firstAccordionTabOpenEl);
testKeyBoardEvent('ArrowUp', secondAccordionTabEl, firstAccordionTabEl);
});

it('Home should focus on the first tab', () => {
testKeyBoardEvent('Home', secondAccordionTabOpenEl, firstAccordionTabOpenEl);
testKeyBoardEvent('Home', secondAccordionTabEl, firstAccordionTabEl);
});

it('End should focus on the last tab', () => {
testKeyBoardEvent('End', firstAccordionTabOpenEl, secondAccordionTabOpenEl);
testKeyBoardEvent('End', firstAccordionTabEl, secondAccordionTabEl);
});
});
});

0 comments on commit 6dc4cc7

Please sign in to comment.