Skip to content

Commit

Permalink
more feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny committed May 24, 2018
1 parent 788ad28 commit 7c42100
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 144 deletions.
2 changes: 1 addition & 1 deletion lighthouse-core/audits/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class Audit {
static makeOpportunityDetails(headings, items, overallSavingsMs, overallSavingsBytes) {
return {
type: 'opportunity',
headings,
headings: items.length === 0 ? [] : headings,
items,
overallSavingsMs,
overallSavingsBytes,
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/report/html/renderer/details-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DetailsRenderer {
// @ts-ignore - TODO(bckenny): Fix type hierarchy
return this._renderTable(/** @type {TableDetailsJSON} */ (details));
case 'code':
return this._renderCode(/** @type {StringDetailsJSON} */ (details));
return this._renderCode(/** @type {DetailsJSON} */ (details));
case 'node':
return this.renderNode(/** @type {NodeDetailsJSON} */(details));
case 'criticalrequestchain':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe('Best Practices: unused css rules audit', () => {
});

it('correctly computes url', () => {
const expectedPreview ='dummy';
const expectedPreview = 'dummy';
assert.strictEqual(map({header: {sourceURL: ''}}).url, expectedPreview);
assert.strictEqual(map({header: {sourceURL: 'a'}}, 'http://g.co/a').url, expectedPreview);
assert.equal(map({header: {sourceURL: 'foobar'}}).url, 'http://g.co/foobar');
Expand Down
149 changes: 8 additions & 141 deletions lighthouse-core/test/results/sample_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -788,18 +788,7 @@
],
"details": {
"type": "opportunity",
"headings": [
{
"key": "url",
"valueType": "url",
"label": "URL"
},
{
"key": "wastedMs",
"valueType": "timespanMs",
"label": "Potential Savings"
}
],
"headings": [],
"items": [],
"overallSavingsMs": 0
}
Expand All @@ -817,18 +806,7 @@
],
"details": {
"type": "opportunity",
"headings": [
{
"key": "url",
"valueType": "url",
"label": "Origin"
},
{
"key": "wastedMs",
"valueType": "timespanMs",
"label": "Potential Savings"
}
],
"headings": [],
"items": [],
"overallSavingsMs": 0
}
Expand Down Expand Up @@ -1881,28 +1859,7 @@
"warnings": [],
"details": {
"type": "opportunity",
"headings": [
{
"key": "url",
"valueType": "thumbnail",
"label": ""
},
{
"key": "url",
"valueType": "url",
"label": "URL"
},
{
"key": "totalBytes",
"valueType": "bytes",
"label": "Original"
},
{
"key": "wastedBytes",
"valueType": "bytes",
"label": "Potential Savings"
}
],
"headings": [],
"items": [],
"overallSavingsMs": 0,
"overallSavingsBytes": 0
Expand Down Expand Up @@ -1975,23 +1932,7 @@
"displayValue": "",
"details": {
"type": "opportunity",
"headings": [
{
"key": "url",
"valueType": "url",
"label": "URL"
},
{
"key": "totalBytes",
"valueType": "bytes",
"label": "Original"
},
{
"key": "wastedBytes",
"valueType": "bytes",
"label": "Potential Savings"
}
],
"headings": [],
"items": [],
"overallSavingsMs": 0,
"overallSavingsBytes": 0
Expand Down Expand Up @@ -2050,23 +1991,7 @@
"displayValue": "",
"details": {
"type": "opportunity",
"headings": [
{
"key": "url",
"valueType": "url",
"label": "URL"
},
{
"key": "totalBytes",
"valueType": "bytes",
"label": "Original"
},
{
"key": "wastedBytes",
"valueType": "bytes",
"label": "Potential Savings"
}
],
"headings": [],
"items": [],
"overallSavingsMs": 0,
"overallSavingsBytes": 0
Expand Down Expand Up @@ -2132,28 +2057,7 @@
"warnings": [],
"details": {
"type": "opportunity",
"headings": [
{
"key": "url",
"valueType": "thumbnail",
"label": ""
},
{
"key": "url",
"valueType": "url",
"label": "URL"
},
{
"key": "totalBytes",
"valueType": "bytes",
"label": "Original"
},
{
"key": "wastedBytes",
"valueType": "bytes",
"label": "Potential Savings"
}
],
"headings": [],
"items": [],
"overallSavingsMs": 0,
"overallSavingsBytes": 0
Expand Down Expand Up @@ -2216,28 +2120,7 @@
"warnings": [],
"details": {
"type": "opportunity",
"headings": [
{
"key": "url",
"valueType": "thumbnail",
"label": ""
},
{
"key": "url",
"valueType": "url",
"label": "URL"
},
{
"key": "totalBytes",
"valueType": "bytes",
"label": "Original"
},
{
"key": "wastedBytes",
"valueType": "bytes",
"label": "Potential Savings"
}
],
"headings": [],
"items": [],
"overallSavingsMs": 0,
"overallSavingsBytes": 0
Expand All @@ -2253,23 +2136,7 @@
"displayValue": "",
"details": {
"type": "opportunity",
"headings": [
{
"key": "url",
"valueType": "url",
"label": "URL"
},
{
"key": "totalBytes",
"valueType": "bytes",
"label": "Transfer Size"
},
{
"key": "wastedBytes",
"valueType": "bytes",
"label": "Byte Savings"
}
],
"headings": [],
"items": [],
"overallSavingsMs": 0,
"overallSavingsBytes": 0
Expand Down

0 comments on commit 7c42100

Please sign in to comment.