From 50ca924316c9d7c2fb3e8fc37cc3e92e501cb66d Mon Sep 17 00:00:00 2001 From: Adam Raine <6752989+adamraine@users.noreply.github.com> Date: Tue, 26 Oct 2021 16:31:56 -0700 Subject: [PATCH] report(pwa): remove gauge alias (#13269) --- report/renderer/pwa-category-renderer.js | 10 ---------- report/renderer/report-renderer.js | 2 +- report/test/renderer/pwa-category-renderer-test.js | 8 ++++---- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/report/renderer/pwa-category-renderer.js b/report/renderer/pwa-category-renderer.js index e9b4406b8b..38600dddd8 100644 --- a/report/renderer/pwa-category-renderer.js +++ b/report/renderer/pwa-category-renderer.js @@ -47,16 +47,6 @@ export class PwaCategoryRenderer extends CategoryRenderer { return categoryElem; } - /** - * Alias for backcompat. - * @param {LH.ReportResult.Category} category - * @param {Record} groupDefinitions - * @return {DocumentFragment} - */ - renderScoreGauge(category, groupDefinitions) { - return this.renderCategoryScore(category, groupDefinitions); - } - /** * @param {LH.ReportResult.Category} category * @param {Record} groupDefinitions diff --git a/report/renderer/report-renderer.js b/report/renderer/report-renderer.js index 0ac7cfcd9a..7c2a6af7f5 100644 --- a/report/renderer/report-renderer.js +++ b/report/renderer/report-renderer.js @@ -212,7 +212,7 @@ export class ReportRenderer { // The renderer for default categories is just the default CategoryRenderer. // If the functions are equal, then renderer is an instance of CategoryRenderer. // For example, the PWA category uses PwaCategoryRenderer, which overrides - // CategoryRenderer.renderScoreGauge, so it would fail this check and be placed + // CategoryRenderer.renderCategoryScore, so it would fail this check and be placed // in the customGauges bucket. defaultGauges.push(categoryGauge); } else { diff --git a/report/test/renderer/pwa-category-renderer-test.js b/report/test/renderer/pwa-category-renderer-test.js index 88a6721673..27185efe18 100644 --- a/report/test/renderer/pwa-category-renderer-test.js +++ b/report/test/renderer/pwa-category-renderer-test.js @@ -249,10 +249,10 @@ describe('PwaCategoryRenderer', () => { }); }); - describe('#renderScoreGauge', () => { + describe('#renderCategoryScore', () => { it('renders an error score gauge in case of category error', () => { category.score = null; - const badgeGauge = pwaRenderer.renderScoreGauge(category, sampleResults.categoryGroups); + const badgeGauge = pwaRenderer.renderCategoryScore(category, sampleResults.categoryGroups); // Not a PWA gauge. assert.strictEqual(badgeGauge.querySelector('.lh-gauge--pwa__wrapper'), null); @@ -263,11 +263,11 @@ describe('PwaCategoryRenderer', () => { }); it('renders score gauges with unique ids for items in ', () => { - const gauge1 = pwaRenderer.renderScoreGauge(category, sampleResults.categoryGroups); + const gauge1 = pwaRenderer.renderCategoryScore(category, sampleResults.categoryGroups); const gauge1Ids = [...gauge1.querySelectorAll('defs [id]')].map(el => el.id); assert.ok(gauge1Ids.length > 2); - const gauge2 = pwaRenderer.renderScoreGauge(category, sampleResults.categoryGroups); + const gauge2 = pwaRenderer.renderCategoryScore(category, sampleResults.categoryGroups); const gauge2Ids = [...gauge2.querySelectorAll('defs [id]')].map(el => el.id); assert.ok(gauge2Ids.length === gauge1Ids.length);