From dd018140e29ef3cb872d3f78340eed7d74eb15b8 Mon Sep 17 00:00:00 2001 From: Andrew Snaith Date: Thu, 10 Jun 2021 13:42:45 -0700 Subject: [PATCH] Add identifier for the upload status box (#1122) Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> --- packages/files-ui/cypress/support/page-objects/homePage.ts | 3 +++ .../src/Components/Modules/UploadProgressModals/UploadBox.tsx | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/files-ui/cypress/support/page-objects/homePage.ts b/packages/files-ui/cypress/support/page-objects/homePage.ts index f676cc733e..4a3fb7e9c2 100644 --- a/packages/files-ui/cypress/support/page-objects/homePage.ts +++ b/packages/files-ui/cypress/support/page-objects/homePage.ts @@ -6,6 +6,7 @@ export const homePage = { // main browser elements uploadButton: () => cy.get("[data-cy=upload-modal-button]"), uploadFileForm: () => cy.get("[data-cy=upload-file-form] input"), + uploadStatusToast: () => cy.get("[data-cy=upload_status_toast_message]", { timeout: 10000 }), // file browser row elements fileItemRow: () => cy.get("[data-cy=file-item-row]", { timeout: 20000 }), @@ -36,7 +37,9 @@ export const homePage = { this.uploadFileForm().attachFile(filePath) this.fileUploadList().should("have.length", 1) this.startUploadButton().click() + // ensure upload is complete before proceeding this.uploadFileForm().should("not.exist") + this.uploadStatusToast().should("not.exist") } } diff --git a/packages/files-ui/src/Components/Modules/UploadProgressModals/UploadBox.tsx b/packages/files-ui/src/Components/Modules/UploadProgressModals/UploadBox.tsx index cef22b5c52..2fa14eb9a1 100644 --- a/packages/files-ui/src/Components/Modules/UploadProgressModals/UploadBox.tsx +++ b/packages/files-ui/src/Components/Modules/UploadProgressModals/UploadBox.tsx @@ -67,7 +67,8 @@ const UploadBox: React.FC = (props) => { return ( <> -
+
{complete ? (