Skip to content

Commit

Permalink
adjust lcp-image
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianaixba committed Nov 18, 2020
1 parent 1f44c98 commit 5511cd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lighthouse-core/audits/preload-lcp-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class PreloadLCPImageAudit extends Audit {
if (!lcpElement) return undefined;

const lcpImageElement = imageElements.find(elem => {
return elem.devtoolsNodePath === lcpElement.devtoolsNodePath;
return elem.node.devtoolsNodePath === lcpElement.node.devtoolsNodePath;
});

if (!lcpImageElement) return undefined;
Expand Down
6 changes: 4 additions & 2 deletions lighthouse-core/test/audits/preload-lcp-image-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ describe('Performance: preload-lcp audit', () => {
TraceElements: [
{
traceEventType: 'largest-contentful-paint',
devtoolsNodePath: '1,HTML,1,BODY,3,DIV,2,IMG',
node: {
devtoolsNodePath: '1,HTML,1,BODY,3,DIV,2,IMG'},
},
],
ImageElements: [
{
src: imageUrl,
devtoolsNodePath: '1,HTML,1,BODY,3,DIV,2,IMG',
node: {
devtoolsNodePath: '1,HTML,1,BODY,3,DIV,2,IMG'},
},
],
};
Expand Down

0 comments on commit 5511cd3

Please sign in to comment.