From 685bda0284daa83e61993777896dd7ecca1b5e72 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Fri, 5 Aug 2016 18:51:30 -0700 Subject: [PATCH] addressing brendan's review for ALL the brownie points. --- lighthouse-core/audits/manifest-background-color.js | 5 +---- lighthouse-core/test/audits/background-color.js | 2 +- lighthouse-core/test/audits/cache-start-url.js | 9 --------- lighthouse-core/test/audits/display.js | 2 +- lighthouse-core/test/audits/exists.js | 6 ------ lighthouse-core/test/audits/start-url.js | 2 +- 6 files changed, 4 insertions(+), 22 deletions(-) diff --git a/lighthouse-core/audits/manifest-background-color.js b/lighthouse-core/audits/manifest-background-color.js index f8dfa8279bfb..a3ea4b5338c6 100644 --- a/lighthouse-core/audits/manifest-background-color.js +++ b/lighthouse-core/audits/manifest-background-color.js @@ -39,7 +39,6 @@ class ManifestBackgroundColor extends Audit { */ static getBackgroundColorValue(manifest) { return manifest !== undefined && - manifest.background_color !== undefined && manifest.background_color.value; } @@ -53,9 +52,7 @@ class ManifestBackgroundColor extends Audit { return ManifestBackgroundColor.generateAuditResult({ rawValue: !!bgColor, extendedInfo: { - value: { - color: bgColor - }, + value: bgColor, formatter: Formatter.SUPPORTED_FORMATS.NULL } }); diff --git a/lighthouse-core/test/audits/background-color.js b/lighthouse-core/test/audits/background-color.js index 2799a8bfda16..f3abd38e91f3 100644 --- a/lighthouse-core/test/audits/background-color.js +++ b/lighthouse-core/test/audits/background-color.js @@ -67,7 +67,7 @@ describe('Manifest: background color audit', () => { }; const output = Audit.audit(artifacts); assert.equal(output.rawValue, true); - assert.equal(output.extendedInfo.value.color, '#FAFAFA'); + assert.equal(output.extendedInfo.value, '#FAFAFA'); }); it('succeeds when a complete manifest contains a background_color', () => { diff --git a/lighthouse-core/test/audits/cache-start-url.js b/lighthouse-core/test/audits/cache-start-url.js index 34bbe4bc7889..4c4876e66960 100644 --- a/lighthouse-core/test/audits/cache-start-url.js +++ b/lighthouse-core/test/audits/cache-start-url.js @@ -45,15 +45,6 @@ describe('Cache: start_url audit', () => { // Need to disable camelcase check for dealing with start_url. /* eslint-disable camelcase */ - it('fails when a manifest artifact contains no start_url', () => { - const artifacts = { - Manifest: { } - }; - const output = Audit.audit(artifacts); - assert.equal(output.rawValue, false); - assert.equal(output.debugString, 'start_url not present in Manifest'); - }); - it('fails when a manifest contains no start_url', () => { const artifacts = { Manifest: manifestParser('{}') diff --git a/lighthouse-core/test/audits/display.js b/lighthouse-core/test/audits/display.js index 13607ef846d2..a24b52883b7e 100644 --- a/lighthouse-core/test/audits/display.js +++ b/lighthouse-core/test/audits/display.js @@ -38,7 +38,7 @@ describe('Mobile-friendly: display audit', () => { it('handles the case where there is no manifest display property', () => { const artifacts = { - Manifest: manifestParser({}) + Manifest: manifestParser('{}') }; const output = Audit.audit(artifacts); diff --git a/lighthouse-core/test/audits/exists.js b/lighthouse-core/test/audits/exists.js index 93aea4dd163b..5d5c11dcb4b8 100644 --- a/lighthouse-core/test/audits/exists.js +++ b/lighthouse-core/test/audits/exists.js @@ -29,12 +29,6 @@ describe('Manifest: exists audit', () => { }}).rawValue, false); }); - it('succeeds when a manifest artifact is present', () => { - return assert.equal(Audit.audit({Manifest: { - value: {} - }}).rawValue, true); - }); - it('succeeds with a valid minimal manifest', () => { const artifacts = { Manifest: manifestParser('{}') diff --git a/lighthouse-core/test/audits/start-url.js b/lighthouse-core/test/audits/start-url.js index 995053a82740..ed0ed4c6a954 100644 --- a/lighthouse-core/test/audits/start-url.js +++ b/lighthouse-core/test/audits/start-url.js @@ -37,7 +37,7 @@ describe('Manifest: start_url audit', () => { assert.equal(output.debugString, undefined); }); - // Need to disable camelcase check for dealing with short_name. + // Need to disable camelcase check for dealing with start_url. /* eslint-disable camelcase */ it('fails when a manifest contains no start_url', () => { const artifacts = {