diff --git a/web/src/tab-summary.ts b/web/src/tab-summary.ts index edba3d3..9854558 100644 --- a/web/src/tab-summary.ts +++ b/web/src/tab-summary.ts @@ -1,5 +1,4 @@ import { LitElement, html, css } from 'lit'; -import { map } from 'lit/directives/map.js'; // eslint-disable-next-line @typescript-eslint/no-unused-vars import { customElement, property } from 'lit/decorators.js'; import { TabSummaryInfo } from './testgrid-dashboard-summary.js'; diff --git a/web/src/testgrid-dashboard-summary.ts b/web/src/testgrid-dashboard-summary.ts index ac39bc7..a9079ba 100644 --- a/web/src/testgrid-dashboard-summary.ts +++ b/web/src/testgrid-dashboard-summary.ts @@ -86,7 +86,7 @@ function convertResponse(ts: TabSummary) { tsi.failuresSummary!.failureStats = failureStats tsi.failuresSummary!.topFailingTests = []; - ts.failuresSummary?.topFailingTests.forEach( (test, i) => { + ts.failuresSummary?.topFailingTests.forEach( (test) => { const failingTest: FailingTestInfo = { displayName: test.displayName, failCount: test.failCount, diff --git a/web/src/testgrid-data-content.ts b/web/src/testgrid-data-content.ts index 5f11663..ea9dc9a 100644 --- a/web/src/testgrid-data-content.ts +++ b/web/src/testgrid-data-content.ts @@ -69,6 +69,13 @@ export class TestgridDataContent extends LitElement { navigateTab(this.dashboardName, this.tabName); } + private handleTabChanged = (evt: Event) => { + this.tabName = (evt).detail.tabName; + this.showTab = !this.showTab; + this.highlightIndex(this.tabName); + navigateTab(this.dashboardName, this.tabName!); + }; + /** * Lit-element lifecycle method. * Invoked when a component is added to the document's DOM. @@ -76,12 +83,16 @@ export class TestgridDataContent extends LitElement { connectedCallback() { super.connectedCallback(); this.fetchTabNames(); - window.addEventListener('tab-changed', (evt: Event) => { - this.tabName = (evt).detail.tabName; - this.showTab = !this.showTab; - this.highlightIndex(this.tabName); - navigateTab(this.dashboardName, this.tabName!); - }); + window.addEventListener('tab-changed', this.handleTabChanged); + } + + /** + * Lit-element lifecycle method. + * Invoked when a component is removed from the document's DOM. + */ + disconnectedCallback() { + super.disconnectedCallback(); + window.removeEventListener('tab-changed', this.handleTabChanged); } /** diff --git a/web/src/testgrid-grid-column-header.ts b/web/src/testgrid-grid-column-header.ts index 0890a8c..b45a28b 100644 --- a/web/src/testgrid-grid-column-header.ts +++ b/web/src/testgrid-grid-column-header.ts @@ -1,5 +1,4 @@ import { LitElement, html, css } from 'lit'; -import { styleMap } from 'lit/directives/style-map.js'; import { customElement, property } from 'lit/decorators.js'; @customElement('testgrid-grid-column-header') diff --git a/web/test/testgrid-dashboard-summary.test.ts b/web/test/testgrid-dashboard-summary.test.ts index 0343d8f..e180bc9 100644 --- a/web/test/testgrid-dashboard-summary.test.ts +++ b/web/test/testgrid-dashboard-summary.test.ts @@ -5,11 +5,9 @@ import { unsafeStatic, expect, waitUntil, - aTimeout, } from '@open-wc/testing'; import { TestgridDashboardSummary } from '../src/testgrid-dashboard-summary.js'; -import { TestgridFailuresSummary } from '../src/testgrid-failures-summary.js'; import { TabSummary } from '../src/tab-summary.js'; describe('Testgrid Dashboard Summary page', () => {