From a6ee38f5a51a53cc9d002ac88ba9b0168bd19c0f Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Sun, 15 Sep 2024 12:05:24 +0100 Subject: [PATCH] feat: [#622] force accept agreetment before uploading --- cypress.config.ts | 2 +- cypress/e2e/contexts/torrent/commands.ts | 2 +- .../e2e/contexts/torrent/specs/upload.cy.ts | 2 +- pages/upload.vue | 30 +++++++++++++++++-- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/cypress.config.ts b/cypress.config.ts index c656f868..c9021044 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -3,7 +3,7 @@ import { grantAdminRole, deleteUser } from "./cypress/e2e/contexts/user/tasks"; import { deleteTorrent, deleteTorrentsInfoFromDatabase } from "./cypress/e2e/contexts/torrent/tasks"; import { deleteCategory, addCategory } from "./cypress/e2e/contexts/category/tasks"; import { deleteTags, addTag } from "./cypress/e2e/contexts/tag/tasks"; -import { DatabaseConfig } from "./cypress/e2e/common/database"; +import type { DatabaseConfig } from "./cypress/e2e/common/database"; function databaseConfig (config: Cypress.PluginConfigOptions): DatabaseConfig { return { diff --git a/cypress/e2e/contexts/torrent/commands.ts b/cypress/e2e/contexts/torrent/commands.ts index 39dce201..bb8412cd 100644 --- a/cypress/e2e/contexts/torrent/commands.ts +++ b/cypress/e2e/contexts/torrent/commands.ts @@ -29,7 +29,7 @@ Cypress.Commands.add("upload_torrent", (torrent_info) => { // the tags context. We could even create some tags before running all the // tests. // cy.get("input[data-cy=\"upload-form-torrent-upload\"]").select('fractals'); - + cy.get("input[data-cy=\"upload-form-agree-terms\"]").check(); cy.get("button[data-cy=\"upload-form-submit\"]").click(); }); diff --git a/cypress/e2e/contexts/torrent/specs/upload.cy.ts b/cypress/e2e/contexts/torrent/specs/upload.cy.ts index 692575ca..6cd09864 100644 --- a/cypress/e2e/contexts/torrent/specs/upload.cy.ts +++ b/cypress/e2e/contexts/torrent/specs/upload.cy.ts @@ -44,7 +44,7 @@ describe("A registered user", () => { // the tags context. We could even create some tags before running all the // tests. // cy.get("input[data-cy=\"upload-form-torrent-upload\"]").select('fractals'); - + cy.get("input[data-cy=\"upload-form-agree-terms\"]").check(); cy.get("button[data-cy=\"upload-form-submit\"]").click(); cy.get("@infohash").then((infohash) => { diff --git a/pages/upload.vue b/pages/upload.vue index 5ef59d68..fad4aeb6 100644 --- a/pages/upload.vue +++ b/pages/upload.vue @@ -41,6 +41,7 @@ + +