Skip to content

Commit

Permalink
remove dependency on cypress-file-uload
Browse files Browse the repository at this point in the history
use selectFile instead
  • Loading branch information
NicolasCARPi committed Jun 8, 2024
1 parent fb8c90e commit 8a39d36
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 24 deletions.
1 change: 0 additions & 1 deletion .github/workflows/validating.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
# fix issue with "Cannot find module 'cypress'"
# https://github.com/cypress-io/github-action/issues/430#issuecomment-949936528
command: yarn test:e2e
command-prefix: yarn dlx
start: yarn start-test-server
wait-on: "http://localhost:8888"
wait-on-timeout: 5
8 changes: 4 additions & 4 deletions cypress/e2e/1-basic/zero_configuration.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ describe("Dropzone with zero configuration", () => {
it("uploads single file", () => {
cy.intercept("POST", "/").as("upload");

cy.get(".dropzone").attachFile("image.jpg", {
subjectType: "drag-n-drop",
cy.get(".dropzone").selectFile("cypress/fixtures/image.jpg", {
action: "drag-drop",
});

cy.wait("@upload").then((interception) => {
Expand All @@ -24,8 +24,8 @@ describe("Dropzone with zero configuration", () => {
cy.intercept("POST", "/").as("upload");

cy.get(".dropzone")
.attachFile("image.jpg", { subjectType: "drag-n-drop" })
.attachFile("image.tiff", { subjectType: "drag-n-drop" })
.selectFile("cypress/fixtures/image.jpg", { action: "drag-drop" })
.selectFile("cypress/fixtures/image.tiff", { action: "drag-drop" })

cy.wait("@upload").then((interception) => {
expect(interception.response.statusCode).to.eq(200);
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/2-integrations/aws-s3-multipart.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ describe("Dropzone with zero configuration", () => {
).as("upload");
cy.intercept("POST", "/amazon-complete").as("complete");

cy.get(".dropzone").attachFile("image.jpg", {
subjectType: "drag-n-drop",
cy.get(".dropzone").selectFile("cypress/fixtures/image.jpg", {
action: "drag-drop",
});
let remainingSize = imageSize;
let partEtags = [];
Expand Down
1 change: 0 additions & 1 deletion cypress/support/commands.js

This file was deleted.

3 changes: 0 additions & 3 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import "./commands";
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"css": "yarn sass src/:dist/ --style compressed",
"watch-css": "yarn sass src/:dist/ --watch --style compressed",
"test": "karma start test/karma.conf.js",
"test:e2e": "yarn run cypress run",
"start-test-server": "node test/test-server.js"
"test:e2e": "cypress run",
"start-test-server": "yarn node test/test-server.js"
},
"bugs": {
"url": "https://github.com/NicolasCARPi/dropzone/issues"
Expand All @@ -63,7 +63,6 @@
"@parcel/transformer-sass": "^2.12.0",
"chai": "^4.4.1",
"cypress": "^13.11.0",
"cypress-file-upload": "^5.0.8",
"express": "^4.19.2",
"karma": "^6.4.3",
"karma-chrome-launcher": "^3.2.0",
Expand Down
10 changes: 0 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ __metadata:
"@swc/helpers": "npm:^0.5.11"
chai: "npm:^4.4.1"
cypress: "npm:^13.11.0"
cypress-file-upload: "npm:^5.0.8"
express: "npm:^4.19.2"
karma: "npm:^6.4.3"
karma-chrome-launcher: "npm:^3.2.0"
Expand Down Expand Up @@ -2235,15 +2234,6 @@ __metadata:
languageName: node
linkType: hard

"cypress-file-upload@npm:^5.0.8":
version: 5.0.8
resolution: "cypress-file-upload@npm:5.0.8"
peerDependencies:
cypress: ">3.0.0"
checksum: 10c0/881a4d9cc16fbf5fd3efc69e1cfa65dd4036c747e2d0e9b7cf32f7f5bb5a137abfd7ce08bd3b7cf802e5d214c0036eabe4e116ccac162445e51e930656375310
languageName: node
linkType: hard

"cypress@npm:^13.11.0":
version: 13.11.0
resolution: "cypress@npm:13.11.0"
Expand Down

0 comments on commit 8a39d36

Please sign in to comment.