Skip to content

Commit be91509

Browse files
authored
test: remove unnecessary afterNextRender from upload test (#9054)
1 parent 78f583d commit be91509

1 file changed

Lines changed: 15 additions & 17 deletions

File tree

‎packages/upload/test/upload.test.js‎

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { expect } from '@vaadin/chai-plugins';
22
import { fixtureSync, nextRender, nextUpdate } from '@vaadin/testing-helpers';
33
import sinon from 'sinon';
44
import '../src/vaadin-upload.js';
5-
import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
65
import { createFile, createFiles, removeFile, xhrCreator } from './helpers.js';
76

87
describe('upload', () => {
@@ -470,26 +469,25 @@ describe('upload', () => {
470469

471470
it('should start a file upload from the file-start event', (done) => {
472471
upload._addFile(file);
473-
afterNextRender(upload, () => {
474-
expect(file.uploaded).not.to.be.ok;
475-
expect(file.held).to.be.true;
476-
expect(file.status).to.be.equal(upload.i18n.uploading.status.held);
477472

478-
upload.addEventListener('upload-start', (e) => {
479-
expect(e.detail.xhr).to.be.ok;
480-
expect(e.detail.file).to.be.ok;
481-
expect(e.detail.file.uploading).to.be.ok;
473+
expect(file.uploaded).not.to.be.ok;
474+
expect(file.held).to.be.true;
475+
expect(file.status).to.be.equal(upload.i18n.uploading.status.held);
482476

483-
done();
484-
});
477+
upload.addEventListener('upload-start', (e) => {
478+
expect(e.detail.xhr).to.be.ok;
479+
expect(e.detail.file).to.be.ok;
480+
expect(e.detail.file.uploading).to.be.ok;
485481

486-
upload.dispatchEvent(
487-
new CustomEvent('file-start', {
488-
detail: { file },
489-
cancelable: true,
490-
}),
491-
);
482+
done();
492483
});
484+
485+
upload.dispatchEvent(
486+
new CustomEvent('file-start', {
487+
detail: { file },
488+
cancelable: true,
489+
}),
490+
);
493491
});
494492
});
495493

0 commit comments

Comments
 (0)