Skip to content

Commit

Permalink
Merge stable branch
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Aug 3, 2022
2 parents 9d03e9f + 8f72280 commit 003b951
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 62 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Expand Up @@ -135,6 +135,25 @@ Released: 2022-05-30
- @uppy/transloadit: remove IE 10 hack (Antoine du Hamel / #3777)


## 2.13.2

Released: 2022-08-02

| Package | Version | Package | Version |
| ----------------- | ------- | ----------------- | ------- |
| @uppy/transloadit | 2.3.6 | @uppy/robodog | 2.9.2 |
| @uppy/tus | 2.4.2 | uppy | 2.13.2 |

- @uppy/transloadit: send `assembly-cancelled` only once (Antoine du Hamel / #3937)
- meta: `keepNames` in bundle (Antoine du Hamel / #3926)
- meta: e2e: fix Transloadit test suite with Cypress 10 (Antoine du Hamel / #3936)
- meta: Bump guzzlehttp/guzzle from 7.4.1 to 7.4.5 in /examples/aws-presigned-url (dependabot[bot] / #3842)
- @uppy/tus: fix dependencies (Antoine du Hamel / #3923)
- meta: doc: fix linter failure in `image-editor.md` (Antoine du Hamel / #3924)
- meta: doc: Fix typo in image-editor.md (Ikko Ashimine / #3921)
- website: Docs and header fix (Artur Paikin / #3920)


## 2.13.1

Released: 2022-07-27
Expand Down
29 changes: 15 additions & 14 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bin/build-bundle.mjs
Expand Up @@ -18,6 +18,7 @@ function buildBundle (srcFile, bundleFile, { minify = true, standalone = '', plu
outfile: bundleFile,
platform: 'browser',
minify,
keepNames: true,
plugins,
target,
format,
Expand Down
74 changes: 74 additions & 0 deletions e2e/cypress/integration/dashboard-transloadit.spec.ts
@@ -1,3 +1,9 @@
const FLAKY = {
retries: {
runMode: 3, // retry flaky test
},
}

describe('Dashboard with Transloadit', () => {
beforeEach(() => {
cy.visit('/dashboard-transloadit')
Expand Down Expand Up @@ -44,6 +50,74 @@ describe('Dashboard with Transloadit', () => {
})
})

it('should emit one assembly-cancelled event when cancelled', FLAKY, () => {
const spy = cy.spy()

cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
cy.get('.uppy-StatusBar-actionBtn--upload').click()

cy.intercept({
method: 'GET',
url: '/assemblies/*',
}).as('assemblyPolling')
cy.intercept(
{ method: 'PATCH', pathname: '/files/*', times: 1 },
{ statusCode: 204, body: {} },
)
cy.intercept(
{ method: 'DELETE', pathname: '/resumable/files/*', times: 2 },
{ statusCode: 204, body: {} },
).as('fileDeletion')
cy.intercept(
{ method: 'DELETE', pathname: '/assemblies/*', times: 1 },
).as('assemblyDeletion')
cy.wait('@assemblyPolling')
cy.window().then(({ uppy }) => {
uppy.on('transloadit:assembly-cancelled', spy)
})
cy.get('button[data-cy=cancel]').click()

cy.wait('@assemblyDeletion').then(() => {
expect(spy).to.be.calledOnce
})
})

it('should close assembly polling when all files are removed', FLAKY, () => {
const spy = cy.spy()

cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
cy.get('.uppy-StatusBar-actionBtn--upload').click()

cy.intercept({
method: 'GET',
url: '/assemblies/*',
}).as('assemblyPolling')
cy.intercept(
{ method: 'PATCH', pathname: '/files/*', times: 1 },
{ statusCode: 204, body: {} },
)
cy.intercept(
{ method: 'DELETE', pathname: '/resumable/files/*', times: 2 },
{ statusCode: 204, body: {} },
).as('fileDeletion')
cy.intercept(
{ method: 'DELETE', pathname: '/assemblies/*', times: 1 },
).as('assemblyDeletion')
cy.wait('@assemblyPolling')
cy.window().then(({ uppy }) => {
uppy.on('transloadit:assembly-cancelled', spy)
expect(Object.values(uppy.getPlugin('Transloadit').activeAssemblies).every((a: any) => a.pollInterval)).to.equal(true)

const { files } = uppy.getState()
uppy.removeFiles(Object.keys(files))

cy.wait('@assemblyDeletion').then(() => {
expect(Object.values(uppy.getPlugin('Transloadit').activeAssemblies).some((a: any) => a.pollInterval)).to.equal(false)
expect(spy).to.be.calledOnce
})
})
})

it('should not create assembly when all individual files have been cancelled', () => {
cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
cy.get('.uppy-StatusBar-actionBtn--upload').click()
Expand Down
87 changes: 45 additions & 42 deletions examples/aws-presigned-url/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/@uppy/robodog/CHANGELOG.md
@@ -1,5 +1,12 @@
# @uppy/robodog

## 2.9.2

Released: 2022-08-02
Included in: Uppy v2.13.2

- @uppy/robodog: Fix Robodog CDN url in readme.md (Artur Paikin / #3922)

## 2.8.3

Released: 2022-07-11
Expand Down
7 changes: 7 additions & 0 deletions packages/@uppy/transloadit/CHANGELOG.md
Expand Up @@ -7,6 +7,13 @@ Included in: Uppy v3.0.0-beta

- @uppy/transloadit: remove IE 10 hack (Antoine du Hamel / #3777)

## 2.3.6

Released: 2022-08-02
Included in: Uppy v2.13.2

- @uppy/transloadit: send `assembly-cancelled` only once (Antoine du Hamel / #3937)

## 2.3.5

Released: 2022-07-27
Expand Down

0 comments on commit 003b951

Please sign in to comment.