Skip to content

Commit

Permalink
remove invalid assertion
Browse files Browse the repository at this point in the history
success event never seems to have included "bytesTotal" in payload
this assertion was mistakenly moved from onProgress to success in 1b5c0d7
  • Loading branch information
mifi committed Jun 28, 2023
1 parent 66e467d commit 2641763
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/@uppy/companion/test/__tests__/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,12 @@ describe('uploader with tus protocol', () => {
// emulate socket connection
socketClient.connect(uploadToken)
socketClient.onProgress(uploadToken, (message) => {
if (firstReceivedProgress == null) firstReceivedProgress = message.payload.bytesUploaded
if (firstReceivedProgress == null) firstReceivedProgress = message.payload
})
socketClient.onUploadSuccess(uploadToken, (message) => {
try {
expect(message.payload.bytesTotal).toBe(fileContent.length)
expect(firstReceivedProgress.bytesUploaded).toBe(8192)

expect(firstReceivedProgress).toBe(8192)
// see __mocks__/tus-js-client.js
expect(message.payload.url).toBe('https://tus.endpoint/files/foo-bar')
} catch (err) {
Expand Down

0 comments on commit 2641763

Please sign in to comment.