Skip to content

Commit

Permalink
test: added defer-upload tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nilshah98 committed Dec 4, 2023
1 parent b6c627e commit 70c0c26
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/storybook.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,30 @@ describe('percy storybook', () => {
'[percy] Snapshot taken: Test: test'
]));
});

it('takes multiple snapshots with defer-uploads and multiple widths', async () => {
fs.writeFileSync('.percy.yml', [
'version: 2',
'percy:',
' defer-uploads: true',
'snapshots:',
' widths:',
' - 1000',
' - 500',
'discovery:',
' request-headers:',
' Authorization: Token xyzzy'
].join('\n'));

await storybook(['http://localhost:8000', '--verbose']);

expect(logger.stderr).toEqual([]);
expect(logger.stdout).toEqual(jasmine.arrayContaining([
'[percy] Snapshot uploaded: Test: test',
'[percy:storybook] Capturing snapshot for width - 1000',
'[percy:storybook] Capturing snapshot for width - 500'
]));
});
});

describe('splitting snapshots', () => {
Expand Down

0 comments on commit 70c0c26

Please sign in to comment.