Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
FSM1 committed Oct 19, 2021
2 parents 4c88f09 + d23d305 commit 9a3e0a4
Show file tree
Hide file tree
Showing 42 changed files with 823 additions and 679 deletions.
2 changes: 1 addition & 1 deletion packages/common-components/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
plugins: [
peerDepsExternal(),
image(),
resolve(),
resolve({ browser: true }),
commonjs(),
typescript(),
postcss({
Expand Down
1 change: 1 addition & 0 deletions packages/common-components/src/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const useStyles = makeStyles(
"&.disabled": {
"& input": {
color: palette.additional["gray"][6],
"-webkit-text-fill-color": palette.additional["gray"][6],
backgroundColor: palette.additional["gray"][3],
...overrides?.TextInput?.input?.disabled
},
Expand Down
10 changes: 2 additions & 8 deletions packages/common-components/src/Toasts/ToastContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CheckCircleIcon, CloseCircleIcon, CloseCirceSvg, CrossSvg } from "../Ic
import { ProgressBar } from "../ProgressBar"
import { Loading } from "../Spinner"

const useStyles = makeStyles(({ constants, palette, animation, overrides }: ITheme) => {
const useStyles = makeStyles(({ constants, palette, overrides }: ITheme) => {
return createStyles({
root: {
backgroundColor: palette.additional["gray"][3],
Expand All @@ -16,10 +16,6 @@ const useStyles = makeStyles(({ constants, palette, animation, overrides }: IThe
padding: constants.generalUnit * 2,
borderRadius: 4,
position: "relative",
"&:hover $closeIcon": {
visibility: "visible",
opacity: 1
},
...overrides?.Toasts?.root
},
progressBox: {
Expand Down Expand Up @@ -66,9 +62,6 @@ const useStyles = makeStyles(({ constants, palette, animation, overrides }: IThe
backgroundColor: palette.additional["gray"][1],
border: "1px solid",
borderColor: palette.additional["gray"][9],
opacity: 0,
visibility: "hidden",
transition: `opacity ${animation.transform}ms`,
display: "flex",
alignItems: "center",
justifyContent: "center",
Expand Down Expand Up @@ -147,6 +140,7 @@ const ToastContent = ({ toast, onClose }: ToastContentProps) => {
}
{isClosable &&
<div
data-testid={`button-close-toast-${toast.testId}`}
className={classes.closeIcon}
onClick={onClose}
>
Expand Down
1 change: 0 additions & 1 deletion packages/files-ui/cypress/support/page-objects/binPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const binPage = {
// bin page specific file browser elements
recoverSelectedButton: () => cy.get("[data-testId=button-recover-selected-file]"),
deleteSelectedButton: () => cy.get("[data-testId=button-delete-selected-file]"),
permanentDeleteSuccessToast: () => cy.get("[data-testId=toast-deletion-success]", { timeout: 10000 }),
selectAllCheckbox: () => cy.get("[data-testId=checkbox-select-all]"),

// kebab menu elements
Expand Down
6 changes: 3 additions & 3 deletions packages/files-ui/cypress/support/page-objects/homePage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { basePage } from "./basePage"
import { fileBrowser } from "./fileBrowser"
import { fileUploadModal } from "./modals/fileUploadModal"
import { uploadCompleteToast } from "./toasts/uploadCompleteToast"

export const homePage = {
...basePage,
Expand All @@ -12,8 +13,6 @@ export const homePage = {
moveSelectedButton: () => cy.get("[data-testId=button-move-selected-file]"),
deleteSelectedButton: () => cy.get("[data-testId=button-delete-selected-file]"),
selectAllCheckbox: () => cy.get("[data-testId=checkbox-select-all]"),
uploadStatusToast: () => cy.get("[data-testId=toast-upload-status]", { timeout: 10000 }),
deleteSuccessToast: () => cy.get("[data-testId=toast-deletion-success]", { timeout: 10000 }),
fileRenameInput: () => cy.get("[data-cy=rename-form] input"),
fileRenameSubmitButton: () => cy.get("[data-cy=rename-submit-button]"),
fileRenameErrorLabel: () => cy.get("[data-cy=rename-form] span.minimal.error"),
Expand All @@ -36,7 +35,8 @@ export const homePage = {

// ensure upload is complete before proceeding
fileUploadModal.body().should("not.exist")
this.uploadStatusToast().should("not.exist")
uploadCompleteToast.body().should("be.visible")
uploadCompleteToast.closeButton().click()
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const deleteSuccessToast = {
body: () => cy.get("[data-testId=toast-deletion-success]", { timeout: 10000 }),
closeButton: () => cy.get("[data-testid=button-close-toast-deletion-success]")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const moveSuccessToast = {
body: () => cy.get("[data-testId=toast-move-success]", { timeout: 10000 }),
closeButton: () => cy.get("[data-testid=button-close-toast-move-success]")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const uploadCompleteToast = {
body: () => cy.get("[data-testId=toast-upload-complete]", { timeout: 10000 }),
closeButton: () => cy.get("[data-testid=button-close-toast-upload-complete]")
}
29 changes: 26 additions & 3 deletions packages/files-ui/cypress/tests/file-management-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import { deleteFileModal } from "../support/page-objects/modals/deleteFileModal"
import { fileUploadModal } from "../support/page-objects/modals/fileUploadModal"
import { moveItemModal } from "../support/page-objects/modals/moveItemModal"
import { recoverItemModal } from "../support/page-objects/modals/recoverItemModal"
import { deleteSuccessToast } from "../support/page-objects/toasts/deleteSuccessToast"
import { moveSuccessToast } from "../support/page-objects/toasts/moveSuccessToast"
import { uploadCompleteToast } from "../support/page-objects/toasts/uploadCompleteToast"

describe("File management", () => {

Expand Down Expand Up @@ -81,6 +84,8 @@ describe("File management", () => {
homePage.moveSelectedButton().click()
moveItemModal.folderList().contains("Home").click()
moveItemModal.moveButton().safeClick()
moveSuccessToast.body().should("be.visible")
moveSuccessToast.closeButton().click()

// ensure the home root now has the folder and file
navigationMenu.homeNavButton().click()
Expand Down Expand Up @@ -174,6 +179,8 @@ describe("File management", () => {
fileUploadModal.removeFileButton().should("have.length", 2)
fileUploadModal.uploadButton().safeClick()
fileUploadModal.body().should("not.exist")
uploadCompleteToast.body().should("be.visible")
uploadCompleteToast.closeButton().click()
homePage.fileItemRow().should("have.length", 2)
})

Expand Down Expand Up @@ -229,6 +236,8 @@ describe("File management", () => {
deleteFileModal.body().should("be.visible")
deleteFileModal.confirmButton().safeClick()
deleteFileModal.body().should("not.exist")
deleteSuccessToast.body().should("be.visible")
deleteSuccessToast.closeButton().click()
homePage.fileItemRow().should("not.exist")

// confirm the deleted file is moved to the bin
Expand Down Expand Up @@ -267,10 +276,14 @@ describe("File management", () => {
homePage.fileItemKebabButton().first().click()
homePage.deleteMenuOption().click()
deleteFileModal.confirmButton().safeClick()
deleteSuccessToast.body().should("be.visible")
deleteSuccessToast.closeButton().click()
navigationMenu.binNavButton().click()
binPage.fileItemKebabButton().first().click()
binPage.deleteMenuOption().click()
deleteFileModal.confirmButton().safeClick()
deleteSuccessToast.body().should("be.visible")
deleteSuccessToast.closeButton().click()
binPage.fileItemRow().should("not.exist")
navigationMenu.homeNavButton().click()
homePage.fileItemRow().should("not.exist")
Expand All @@ -288,6 +301,8 @@ describe("File management", () => {
deleteFileModal.body().should("be.visible")
deleteFileModal.confirmButton().safeClick()
deleteFileModal.body().should("not.exist")
deleteSuccessToast.body().should("be.visible")
deleteSuccessToast.closeButton().click()
homePage.fileItemRow().should("not.exist")

// confirm the deleted folder is moved to the bin
Expand All @@ -312,10 +327,14 @@ describe("File management", () => {
homePage.fileItemKebabButton().first().click()
homePage.deleteMenuOption().click()
deleteFileModal.confirmButton().safeClick()
deleteSuccessToast.body().should("be.visible")
deleteSuccessToast.closeButton().click()
navigationMenu.binNavButton().click()
binPage.fileItemKebabButton().first().click()
binPage.deleteMenuOption().click()
deleteFileModal.confirmButton().safeClick()
deleteSuccessToast.body().should("be.visible")
deleteSuccessToast.closeButton().click()
binPage.fileItemRow().should("not.exist")
navigationMenu.homeNavButton().click()
homePage.fileItemRow().should("not.exist")
Expand Down Expand Up @@ -366,12 +385,15 @@ describe("File management", () => {
homePage.fileItemKebabButton().click()
homePage.deleteMenuOption().click()
deleteFileModal.confirmButton().safeClick()
homePage.deleteSuccessToast().should("not.exist")
deleteSuccessToast.body().should("be.visible")
deleteSuccessToast.closeButton().click()

navigationMenu.binNavButton().click()
binPage.fileItemKebabButton().click()
binPage.deleteMenuOption().click()
deleteFileModal.confirmButton().safeClick()
binPage.permanentDeleteSuccessToast().should("not.exist")
deleteSuccessToast.body().should("be.visible")
deleteSuccessToast.closeButton().click()
navigationMenu.spaceUsedLabel().should("contain.text", "0 Bytes")
})

Expand All @@ -391,7 +413,8 @@ describe("File management", () => {
homePage.selectAllCheckbox().click()
homePage.deleteSelectedButton().click()
deleteFileModal.confirmButton().safeClick()
homePage.deleteSuccessToast().should("not.exist")
deleteSuccessToast.body().should("be.visible")
deleteSuccessToast.closeButton().click()
homePage.fileItemRow().should("have.length", 0)

// recover both of the files in the same action
Expand Down
1 change: 0 additions & 1 deletion packages/files-ui/cypress/tests/file-preview-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ describe("File Preview", () => {
homePage.fileItemName().dblclick()
previewModal.unsupportedFileLabel().should("exist")
previewModal.downloadUnsupportedFileButton().should("be.visible")

// ensure the download request contains the correct file
cy.get("@downloadRequest").its("request.body").should("contain", {
path: "/file.zip"
Expand Down
4 changes: 2 additions & 2 deletions packages/files-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@babel/core": "^7.12.10",
"@babel/runtime": "^7.0.0",
"@chainsafe/browser-storage-hooks": "^1.0.1",
"@chainsafe/files-api-client": "^1.18.10",
"@chainsafe/files-api-client": "1.18.15",
"@chainsafe/web3-context": "1.1.4",
"@lingui/core": "^3.7.2",
"@lingui/react": "^3.7.2",
Expand Down Expand Up @@ -70,7 +70,7 @@
"@types/yup": "^0.29.9",
"@types/zxcvbn": "^4.4.0",
"babel-plugin-macros": "^2.8.0",
"cypress": "^8.4",
"cypress": "^8.6",
"cypress-file-upload": "^5.0.8",
"cypress-pipe": "^2.0.0"
},
Expand Down
Loading

0 comments on commit 9a3e0a4

Please sign in to comment.