From 632b6425366de9d86a30ebf1f1fbc75419981aef Mon Sep 17 00:00:00 2001 From: Reza Rahemtola Date: Sun, 25 Jun 2023 19:50:38 +0200 Subject: [PATCH] style: fix prettier warnings --- cypress/e2e/front/landing.cy.ts | 119 +++++++++++++++++--------------- cypress/e2e/front/signup.cy.ts | 2 +- pages/drive/index.tsx | 3 +- pages/drive/shared.tsx | 5 +- pages/drive/trash.tsx | 2 +- 5 files changed, 69 insertions(+), 62 deletions(-) diff --git a/cypress/e2e/front/landing.cy.ts b/cypress/e2e/front/landing.cy.ts index 1889ee49..44d7e0f6 100644 --- a/cypress/e2e/front/landing.cy.ts +++ b/cypress/e2e/front/landing.cy.ts @@ -1,55 +1,64 @@ -describe('Good front for Landing', () => { - it('Go to landing', () => { - cy.visit(''); - }); - - it ('Good text', () => { - cy.get('#ipc-landing-navigation-name').should('contain', 'Inter Planetary Cloud'); - cy.get("#ipc-landing-headline").should('contain', 'The first distributed cloud unsealing your data.'); - cy.get("#ipc-landing-subHeadline").should('contain', 'Build on top of Aleph, the next generation network of distributed big data applications.'); - cy.get("#ipc-landing-services-title").should('contain', 'Inter Planetary Cloud offers two services'); - cy.get("#ipc-landing-features-title").should('contain', 'Our Features'); - }) - - it('Good text for features cards', () => { - cy.get("#ipc-landing-feature-upload-files").should('contain', 'Upload & Download Files'); - cy.get("#ipc-landing-folder-management").should('contain', 'Folder Management'); - cy.get("#ipc-landing-share-files").should('contain', 'Share Files'); - cy.get("#ipc-landing-programs").should('contain', 'Upload & Run Programs'); - cy.get("#ipc-landing-contact-management").should('contain', 'Contact Management'); - }) - - it('Good text for services cards', () => { - cy.get("#ipc-landing-services-cloud-storage-title").should('contain', 'Cloud Storage'); - cy.get("#ipc-landing-services-cloud-storage-description").should('contain', 'A distributed personal file storage and management system platform, protecting your data.'); - cy.get('#ipc-landing-services-cloud-computing-title').should('contain', 'Cloud Computing'); - cy.get('#ipc-landing-services-cloud-computing-description').should('contain', 'A distributed personal cloud computing platform for HTTP servers.'); - }); - - it('Good text for start buttons', () => { - cy.get("#ipc-landing-heading-start-button").should('contain', 'Start the experiment'); - cy.get("#ipc-landing-features-start-button").should('contain', 'Start the experiment'); - }) - - it('Good number of elements', () => { - cy.get("button").should('have.length', 2); - cy.get('img').should('have.length', 7); - cy.get('svg').should('have.length', 14); - cy.get('#ipc-landing-services-cloud-storage').should('have.length', 1); - cy.get('#ipc-landing-services-cloud-computing').should('have.length', 1); - }) -}); - -describe('Good redirect for Landing', () => { - beforeEach(() => { - cy.visit(''); - }); - - it('Good redirection for heading button', () => { - cy.get("#ipc-landing-heading-start-button").click().url().should('eq', `${Cypress.config().baseUrl}/connection`); - }); - - it('Good redirection for features button', () => { - cy.get("#ipc-landing-features-start-button").click().url().should('eq', `${Cypress.config().baseUrl}/connection`); - }); -}); \ No newline at end of file +describe('Good front for Landing', () => { + it('Go to landing', () => { + cy.visit(''); + }); + + it('Good text', () => { + cy.get('#ipc-landing-navigation-name').should('contain', 'Inter Planetary Cloud'); + cy.get('#ipc-landing-headline').should('contain', 'The first distributed cloud unsealing your data.'); + cy.get('#ipc-landing-subHeadline').should( + 'contain', + 'Build on top of Aleph, the next generation network of distributed big data applications.', + ); + cy.get('#ipc-landing-services-title').should('contain', 'Inter Planetary Cloud offers two services'); + cy.get('#ipc-landing-features-title').should('contain', 'Our Features'); + }); + + it('Good text for features cards', () => { + cy.get('#ipc-landing-feature-upload-files').should('contain', 'Upload & Download Files'); + cy.get('#ipc-landing-folder-management').should('contain', 'Folder Management'); + cy.get('#ipc-landing-share-files').should('contain', 'Share Files'); + cy.get('#ipc-landing-programs').should('contain', 'Upload & Run Programs'); + cy.get('#ipc-landing-contact-management').should('contain', 'Contact Management'); + }); + + it('Good text for services cards', () => { + cy.get('#ipc-landing-services-cloud-storage-title').should('contain', 'Cloud Storage'); + cy.get('#ipc-landing-services-cloud-storage-description').should( + 'contain', + 'A distributed personal file storage and management system platform, protecting your data.', + ); + cy.get('#ipc-landing-services-cloud-computing-title').should('contain', 'Cloud Computing'); + cy.get('#ipc-landing-services-cloud-computing-description').should( + 'contain', + 'A distributed personal cloud computing platform for HTTP servers.', + ); + }); + + it('Good text for start buttons', () => { + cy.get('#ipc-landing-heading-start-button').should('contain', 'Start the experiment'); + cy.get('#ipc-landing-features-start-button').should('contain', 'Start the experiment'); + }); + + it('Good number of elements', () => { + cy.get('button').should('have.length', 2); + cy.get('img').should('have.length', 7); + cy.get('svg').should('have.length', 14); + cy.get('#ipc-landing-services-cloud-storage').should('have.length', 1); + cy.get('#ipc-landing-services-cloud-computing').should('have.length', 1); + }); +}); + +describe('Good redirect for Landing', () => { + beforeEach(() => { + cy.visit(''); + }); + + it('Good redirection for heading button', () => { + cy.get('#ipc-landing-heading-start-button').click().url().should('eq', `${Cypress.config().baseUrl}/connection`); + }); + + it('Good redirection for features button', () => { + cy.get('#ipc-landing-features-start-button').click().url().should('eq', `${Cypress.config().baseUrl}/connection`); + }); +}); diff --git a/cypress/e2e/front/signup.cy.ts b/cypress/e2e/front/signup.cy.ts index d99cefcc..b3ac16d0 100644 --- a/cypress/e2e/front/signup.cy.ts +++ b/cypress/e2e/front/signup.cy.ts @@ -29,7 +29,7 @@ describe('Good front for Signup', () => { it('Good name for go to dashboard button', () => { cy.get('#ipc-signup-go-to-dashboard-button').should('contain', 'Go to my dashboard'); - }) + }); }); describe('Signup with credentials Button for Signup', () => { diff --git a/pages/drive/index.tsx b/pages/drive/index.tsx index 3ee93d94..422f39b0 100644 --- a/pages/drive/index.tsx +++ b/pages/drive/index.tsx @@ -15,7 +15,8 @@ const Dashboard = (): JSX.Element => { const { setConfig } = useConfigContext(); const { colorMode, toggleColorMode } = useColorMode(); - const { path, folders, files, setFiles, setFolders, setContacts, setPrograms, setSharedFiles, setSharedPrograms } = useDriveContext(); + const { path, folders, files, setFiles, setFolders, setContacts, setPrograms, setSharedFiles, setSharedPrograms } = + useDriveContext(); useEffect(() => { (async () => { diff --git a/pages/drive/shared.tsx b/pages/drive/shared.tsx index bec51105..3ef2e915 100644 --- a/pages/drive/shared.tsx +++ b/pages/drive/shared.tsx @@ -14,10 +14,7 @@ const Shared = (): JSX.Element => { - !elem.deletedAt)} - programs={sharedPrograms} - /> + !elem.deletedAt)} programs={sharedPrograms} /> ); diff --git a/pages/drive/trash.tsx b/pages/drive/trash.tsx index ae64c5a2..1dbc0e3b 100644 --- a/pages/drive/trash.tsx +++ b/pages/drive/trash.tsx @@ -8,7 +8,7 @@ import Navigation from 'components/navigation/Navigation'; import { useDriveContext } from 'contexts/drive'; const Trash = (): JSX.Element => { - const { path, files, folders, sharedFiles} = useDriveContext(); + const { path, files, folders, sharedFiles } = useDriveContext(); const deletedFiles = files.filter((elem) => elem.path === path && elem.deletedAt !== null); const deletedFolders = folders.filter((elem) => elem.path === path);