Skip to content

Commit

Permalink
chore(Upload): adds screenshot test for disabled file max size (#4209)
Browse files Browse the repository at this point in the history
  • Loading branch information
langz authored Nov 4, 2024
2 parents c966bc1 + 5bafc69 commit ad3ce2d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export const UploadFileMaxSizeBasedOnFileTypeDisabled = () => (
)

export const UploadDisabledFileMaxSize = () => (
<ComponentBox>
<ComponentBox data-visual-test="upload-disabled-file-max-size">
<Upload
acceptedFileTypes={['jpg', 'pdf']}
id="upload-disabled-file-max-size"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ To disable `maxFileSize` Use either `0` or `false`. If `maxFileSize` is not prov
You can disable the file max size, which will deactivate all file size verifications in the Upload component.
This can also be used to manually implement more complex file max size verifications.

<VisibleWhenNotVisualTest>
<UploadDisabledFileMaxSize />
</VisibleWhenNotVisualTest>
<UploadDisabledFileMaxSize />

### Upload without title and text

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ describe.each(['ui', 'sbanken'])('Upload for %s', (themeName) => {
expect(screenshot).toMatchImageSnapshot()
})

it('have to match disabled file max size', async () => {
const screenshot = await makeScreenshot({
selector: '[data-visual-test="upload-disabled-file-max-size"]',
})
expect(screenshot).toMatchImageSnapshot()
})

it('have to match when not providing title and text', async () => {
const screenshot = await makeScreenshot({
selector: '[data-visual-test="upload-no-title-no-text"]',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ad3ce2d

Please sign in to comment.