Skip to content

Commit

Permalink
Remove extra code and improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmay-browserstack committed Sep 18, 2024
1 parent ebed72a commit d487b6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions packages/core/src/discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,7 @@ function processSnapshotResources({ domSnapshot, resources, ...snapshot }) {
if (roots.length === 0) {
let domResources = parseDomResources({ ...snapshot, domSnapshot });
resources = [...domResources.values(), ...resources];
if (Array.isArray(domSnapshot)) {
roots = resources.find(r => Array.isArray(r));
} else {
roots = [resources[0]];
}
roots = [resources[0]];
}

// inject Percy CSS
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/discovery.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2895,11 +2895,12 @@ describe('Discovery', () => {
name: 'test snapshot',
url: 'http://localhost:8000',
multiDOM: true,
widths: [365, 1280],
domSnapshot: [{
domSnapshot: testDOM,
width: 1280
}, {
domSnapshot: DOM1,
domSnapshot: { html: DOM1 },
width: 370
}, {
domSnapshot: DOM2,
Expand Down

0 comments on commit d487b6a

Please sign in to comment.