-
diff --git a/lighthouse-core/test/report/html/renderer/performance-category-renderer-test.js b/lighthouse-core/test/report/html/renderer/performance-category-renderer-test.js
index 49df1c89f011..39c8dfe78f5d 100644
--- a/lighthouse-core/test/report/html/renderer/performance-category-renderer-test.js
+++ b/lighthouse-core/test/report/html/renderer/performance-category-renderer-test.js
@@ -85,14 +85,14 @@ describe('PerfCategoryRenderer', () => {
const oppAudits = category.audits.filter(audit => audit.group === 'load-opportunities' &&
audit.result.score !== 1);
- const oppElements = categoryDOM.querySelectorAll('.lh-load-opportunity');
+ const oppElements = categoryDOM.querySelectorAll('.lh-audit--load-opportunity');
assert.equal(oppElements.length, oppAudits.length);
const oppElement = oppElements[0];
const oppSparklineBarElement = oppElement.querySelector('.lh-sparkline__bar');
const oppSparklineElement = oppElement.querySelector('.lh-load-opportunity__sparkline');
- const oppTitleElement = oppElement.querySelector('.lh-load-opportunity__title');
- const oppWastedElement = oppElement.querySelector('.lh-load-opportunity__wasted-stat');
+ const oppTitleElement = oppElement.querySelector('.lh-audit__title');
+ const oppWastedElement = oppElement.querySelector('.lh-audit__display-text');
assert.ok(oppTitleElement.textContent, 'did not render title');
assert.ok(oppSparklineBarElement.style.width, 'did not set sparkline width');
assert.ok(oppWastedElement.textContent, 'did not render stats');
@@ -105,14 +105,33 @@ describe('PerfCategoryRenderer', () => {
group: 'load-opportunities',
result: {
score: null, scoreDisplayMode: 'error', errorMessage: 'Yikes!!', description: 'Bug #2',
+ details: {summary: {wastedMs: 3223}},
+ },
+ };
+
+ const fakeCategory = Object.assign({}, category, {audits: [auditWithDebug]});
+ const categoryDOM = renderer.render(fakeCategory, sampleResults.reportGroups);
+ const debugEl = categoryDOM.querySelector('.lh-audit--load-opportunity .lh-debug');
+ assert.ok(debugEl, 'did not render debug');
+ assert.ok(/Yikes!!/.test(debugEl.textContent));
+ });
+
+ it('renders errored performance opportunities with a debug string', () => {
+ const auditWithDebug = {
+ score: 0,
+ group: 'load-opportunities',
+ result: {
+ score: 0, scoreDisplayMode: 'numeric',
+ rawValue: 100, explanation: 'Yikes!!', description: 'Bug #2',
},
};
const fakeCategory = Object.assign({}, category, {audits: [auditWithDebug]});
const categoryDOM = renderer.render(fakeCategory, sampleResults.reportGroups);
- const debugEl = categoryDOM.querySelector('.lh-load-opportunity .lh-debug');
+ const debugEl = categoryDOM.querySelector('.lh-audit--load-opportunity .lh-debug');
assert.ok(debugEl, 'did not render debug');
+ assert.ok(/Yikes!!/.test(debugEl.textContent));
});
it('renders the failing diagnostics', () => {
diff --git a/lighthouse-extension/test/extension-test.js b/lighthouse-extension/test/extension-test.js
index 829f2cf3090d..73ecee22e51c 100644
--- a/lighthouse-extension/test/extension-test.js
+++ b/lighthouse-extension/test/extension-test.js
@@ -117,8 +117,8 @@ describe('Lighthouse chrome extension', function() {
const selectors = {
- audits: '.lh-audit,.lh-metric,.lh-load-opportunity',
- titles: '.lh-audit__title, .lh-load-opportunity__title, .lh-metric__title',
+ audits: '.lh-audit, .lh-metric',
+ titles: '.lh-audit__title, .lh-metric__title',
};
it('should contain all categories', async () => {
diff --git a/lighthouse-viewer/test/viewer-test-pptr.js b/lighthouse-viewer/test/viewer-test-pptr.js
index c9982c11b14b..2afde324403e 100644
--- a/lighthouse-viewer/test/viewer-test-pptr.js
+++ b/lighthouse-viewer/test/viewer-test-pptr.js
@@ -74,8 +74,8 @@ describe('Lighthouse Viewer', function() {
const selectors = {
- audits: '.lh-audit, .lh-metric, .lh-load-opportunity',
- titles: '.lh-audit__title, .lh-load-opportunity__title, .lh-metric__title',
+ audits: '.lh-audit, .lh-metric',
+ titles: '.lh-audit__title, .lh-metric__title',
};
it('should load with no errors', async () => {