Skip to content

Commit 5be90ea

Browse files
committed
add test that the signedUrl download works
1 parent 62748a8 commit 5be90ea

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/integration/access/AccessRepository.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@ describe('AccessRepository', () => {
6363
})
6464

6565
describe('submitGuestbookForDatafileDownload', () => {
66-
test('should return signed url for datafile download', async () => {
66+
test('should return signed url that can be used to download the datafile', async () => {
6767
const actual = await sut.submitGuestbookForDatafileDownload(testFileId, guestbookResponse)
68+
const downloadResponse = await fetch(actual)
6869

6970
expect(actual).toEqual(expect.any(String))
7071
expect(() => new URL(actual)).not.toThrow()
72+
expect(downloadResponse.ok).toBe(true)
73+
await expect(downloadResponse.text()).resolves.toBe('test file 1\n')
7174
})
7275

7376
test('should return error when datafile does not exist', async () => {

0 commit comments

Comments
 (0)