Skip to content

Commit

Permalink
clients(psi): include global reports styles in legacy psi rendering (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish authored Sep 30, 2021
1 parent b132cf7 commit b0fa0f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions report/clients/psi.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function prepareLabData(LHResult, document) {
reportLHR.categoryGroups,
{environment: 'PSI', gatherMode: lhResult.gatherMode}
);
perfCategoryEl.append(dom.createComponent('styles'));

const scoreGaugeEl = dom.find('.lh-score__gauge', perfCategoryEl);
scoreGaugeEl.remove();
Expand Down
5 changes: 2 additions & 3 deletions report/test/clients/psi-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ describe('PSI', () => {
// Check that the report exists and has some content.
assert.ok(result.perfCategoryEl instanceof document.defaultView.Element);
assert.ok(result.perfCategoryEl.outerHTML.length > 50000, 'perfCategory HTML is populated');
assert.ok(!result.perfCategoryEl.outerHTML.includes('lh-permalink'),
'PSI\'s perfCategory HTML doesn\'t include a lh-permalink element');
// Assume using default locale.
const title = result.perfCategoryEl.querySelector('.lh-audit-group--metrics')
.querySelector('.lh-audit-group__title').textContent;
Expand All @@ -83,7 +81,8 @@ describe('PSI', () => {

assert.ok(result.perfCategoryEl instanceof document.defaultView.Element);
assert.ok(result.perfCategoryEl.outerHTML.length > 50000, 'perfCategory HTML is populated');
assert.ok(!result.perfCategoryEl.outerHTML.includes('lh-permalink'),
// styles for .lh-permalink are ok, but not the HTML
assert.ok(!result.perfCategoryEl.outerHTML.includes('class="lh-permalink'),
'PSI\'s perfCategory HTML doesn\'t include a lh-permalink element');

assert.equal(typeof result.finalScreenshotDataUri, 'string');
Expand Down

0 comments on commit b0fa0f6

Please sign in to comment.