Skip to content

Commit

Permalink
Merge pull request #80 from PoCInnovation/dev
Browse files Browse the repository at this point in the history
feat: Migration to Next and Aggregates
  • Loading branch information
RezaRahemtola committed Jul 6, 2022
2 parents 433704f + 3fb3143 commit d87237d
Show file tree
Hide file tree
Showing 67 changed files with 3,962 additions and 12,268 deletions.
4 changes: 0 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
LICENSE
README.md

# Linter
.prettierc
.eslintrc.yaml

# Node
node_modules/
tests/
Expand Down
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
REACT_APP_ALEPH_CHANNEL=TEST
PORT=8080
NEXT_PUBLIC_ALEPH_CHANNEL=TEST
4 changes: 3 additions & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ env:
browser: true

extends:
- airbnb-base
- airbnb-typescript
- airbnb/hooks
- plugin:@typescript-eslint/recommended
- plugin:@next/next/recommended
- prettier
- react-app

plugins:
- prettier
Expand All @@ -25,6 +26,7 @@ rules:
prettier/prettier: warn

react/react-in-jsx-scope: 0
react/jsx-filename-extension: 0
react/no-unescaped-entities: 0
react/jsx-props-no-spreading: 0
react/require-default-props: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/end-to-end-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
run: docker build . -t ipc:latest

- name: Run cypress
uses: cypress-io/github-action@v2
uses: cypress-io/github-action@v4
with:
start: docker run -p 8080:80 ipc:latest
wait-on: "http://localhost:8080"
Expand Down
20 changes: 14 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

# env
.env
.env*.local

# editors
.idea/

cypress/downloads
.vscode/

# dependencies
node_modules
Expand All @@ -11,24 +14,29 @@ node_modules

# testing
/coverage
cypress/screenshots
cypress/videos
cypress/downloads

# next.js
/.next/
/build/

# production
/build

# misc
.DS_Store
*.pem
.env.local
.env.development.local
.env.test.local
.env.production.local

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

cypress/screenshots
cypress/videos

.metamask

/.vscode
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN yarn install
COPY . .

# Add env variable
ENV REACT_APP_ALEPH_CHANNEL=TEST
ENV NEXT_PUBLIC_ALEPH_CHANNEL=TEST

# Build source
RUN yarn run build
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ We use [Aleph SDK TS](https://github.com/aleph-im/aleph-sdk-ts#readme).
## Our PoC team :ok_hand:

### April 2022 - September 2022
Developpers - Team Storage:
Developers - Team Storage:

| [<img src="https://github.com/RezaRahemtola.png?size=85" width=85><br><sub>Reza Rahemtola</sub>](https://github.com/RezaRahemtola) | [<img src="https://github.com/TristanMasselot.png?size=85" width=85><br><sub>Tristan Masselot</sub>](https://github.com/TristanMasselot) | [<img src="https://github.com/Samoten777.png?size=85" width=85><br><sub>Samoten 777</sub>](https://github.com/Samoten777)
| [<img src="https://github.com/RezaRahemtola.png?size=85" width=85><br><sub>Reza Rahemtola</sub>](https://github.com/RezaRahemtola) | [<img src="https://github.com/TristanMasselot.png?size=85" width=85><br><sub>Tristan Masselot</sub>](https://github.com/TristanMasselot) | [<img src="https://github.com/Samoten777.png?size=85" width=85><br><sub>Laure Gagner</sub>](https://github.com/Samoten777)
|:---:|:---:|:---:|

Developpers - Team Computing:
Developers - Team Computing:

| [<img src="https://github.com/AmozPay.png?size=85" width=85><br><sub>Amoz Pay</sub>](https://github.com/AmozPay)| [<img src="https://github.com/ZerLock.png?size=85" width=85><br><sub>Léo Dubosclard</sub>](https://github.com/ZerLock) | [<img src="https://github.com/Alex-Prevot.png?size=85" width=85><br><sub>Alex Prevot</sub>](https://github.com/Alex-Prevot)
|:---:|:---:|:---:|
Expand All @@ -257,11 +257,11 @@ Project Managers:

### March 2021 - September 2021
Developers:
| [<img src="https://github.com/adrienfort.png?size=85" width=85><br><sub>Adrien Fort</sub>](https://github.com/adrienfort) | [<img src="https://github.com/rojasdiegopro.png?size=85" width=85><br><sub>Diego Rojas</sub>](https://github.com/rojasdiegopro) | [<img src="https://github.com/MrZalTy.png?size=85" width=85><br><sub>Lorenzo Carneli</sub>](https://github.com/MrZalTy)
| [<img src="https://github.com/adrienfort.png?size=85" width=85><br><sub>Adrien Fort</sub>](https://github.com/adrienfort) | [<img src="https://github.com/rojas-diego.png?size=85" width=85><br><sub>Diego Rojas</sub>](https://github.com/rojas-diego) | [<img src="https://github.com/MrZalTy.png?size=85" width=85><br><sub>Lorenzo Carneli</sub>](https://github.com/MrZalTy)
| :---: | :---: | :---: |

Project Managers:
| [<img src="https://github.com/NaadiQmmr.png?size=85" width=85><br><sub>Adina Cazalens</sub>](https://github.com/NaadiQmmr) | [<img src="https://github.com/PtitLuca.png?size=85" width=85><br><sub>Luca Georges Francois</sub>](https://github.com/PtitLuca)
| [<img src="https://github.com/NaadiQmmr.png?size=85" width=85><br><sub>Adina Cazalens</sub>](https://github.com/NaadiQmmr) | [<img src="https://github.com/0xpanoramix.png?size=85" width=85><br><sub>Luca Georges Francois</sub>](https://github.com/0xpanoramix)
| :---: | :---: |

Reviewers :
Expand Down
13 changes: 13 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'cypress';

export default defineConfig({
watchForFileChanges: false,
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'http://localhost:8080',
},
})
4 changes: 0 additions & 4 deletions cypress.json

This file was deleted.

70 changes: 70 additions & 0 deletions cypress/e2e/features/files.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
let dashboardSpecMnemonic = '';

describe('Create account for File tests', () => {
it('Connect', () => {
cy.visit('/signup');
cy.get('#ipc-signup-credentials-signup-button').click();
cy.get('#ipc-signup-text-area')
.invoke('val')
.then((input) => {
dashboardSpecMnemonic = input as string;
});
cy.get('#ipc-modal-close-button').click();
});
});

describe('Upload a file modal in Dashboard', () => {
const fixtureFile = 'upload_test_file.txt';

beforeEach(() => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-upload-button').click();
});

it('Good number of buttons after upload', () => {
cy.get('#ipc-dashboard-upload-file').attachFile(fixtureFile);
cy.get('#ipc-dashboard-upload-file-modal-button').click();
cy.wait(2000);
cy.get('button').should('have.length', 12);
});

it('Good number of buttons after closing modal', () => {
cy.get('#ipc-modal-close-button').click();
cy.get('button').should('have.length', 12);
});
});

describe('Upload an empty file in Dashboard', () => {
const fixtureFile = 'upload_empty_file.txt';

beforeEach(() => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-upload-button').click();
});

it('Good number of buttons after failed upload', () => {
cy.get('#ipc-dashboard-upload-file').attachFile(fixtureFile, { allowEmpty: true });
cy.get('#ipc-dashboard-upload-file-modal-button').click();
cy.wait(2000);
cy.get('button').should('have.length', 12);
});
});

describe('Download a file in Dashboard', () => {
beforeEach(() => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-download-button').click();
});

it('Good content for downloaded file', () => {
cy.readFile('./cypress/downloads/upload_test_file.txt').should('eq', 'This is an upload test file');
});
});
36 changes: 36 additions & 0 deletions cypress/e2e/features/programs.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
describe('Create account for Dashboard tests', () => {
it('Connect', () => {
cy.visit('/signup');
cy.get('#ipc-signup-credentials-signup-button').click();
cy.get('#ipc-signup-text-area')
.invoke('val')
.then((input) => {
dashboardSpecMnemonic = input as string;
});
cy.get('#ipc-modal-close-button').click();
});
});

describe('Upload a program modal for Dashboard', () => {
const fixtureFile = 'upload_test_program.zip';

beforeEach(() => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-deploy-button').click().wait(2500);
});

it('Good number of buttons after upload', () => {
cy.get('#ipc-dashboard-deploy-program').attachFile(fixtureFile);
cy.get('#ipc-dashboard-deploy-program-modal-button').click();
cy.wait(2000);
cy.get('button').should('have.length', 10);
});

it('Good number of buttons after closing modal', () => {
cy.get('#ipc-modal-close-button').click();
cy.get('button').should('have.length', 10);
});
});
94 changes: 94 additions & 0 deletions cypress/e2e/front/dashboard.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
describe('Create account for Dashboard tests', () => {
it('Connect', () => {
cy.visit('/signup');
cy.get('#ipc-signup-credentials-signup-button').click();
cy.get('#ipc-signup-text-area')
.invoke('val')
.then((input) => {
dashboardSpecMnemonic = input as string;
});
cy.get('#ipc-modal-close-button').click();
});
});

describe('Good front for Dashboard', () => {
it('Go to dashboard', () => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
});

it('Good title', () => {
cy.get('#ipc-sideBar-title').should('contain', 'Inter Planetary Cloud');
});

it('Good name for upload button', () => {
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-upload-button').should('contain', 'Upload a file');
});

it('Good name for deploy button', () => {
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-deploy-button').should('contain', 'Deploy a program');
});
});

describe('Good Upload file modal front in Dashboard', () => {
it('Go to upload modal into dashboard', () => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-upload-button').click();
});

it('Good header', () => {
cy.get('header').should('contain', 'Upload a file');
});

it('Good number of buttons', () => {
cy.get('button').should('have.length', 10);
});

it('Good number of input', () => {
cy.get('input[type=file]').should('have.length', 1);
});

it('Good name for upload a file button', () => {
cy.get('#ipc-dashboard-upload-file-modal-button').should('contain', 'Upload file');
});

it('Good name for close button', () => {
cy.get('#ipc-modal-close-button').should('contain', 'Close');
});
});

describe('Good Deploy program modal front in Dashboard', () => {
it('Go to upload modal into dashboard', () => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-deploy-button').click();
});

it('Good header', () => {
cy.get('header').should('contain', 'Deploy a program');
});

it('Good number of buttons', () => {
cy.get('button').should('have.length', 10);
});

it('Good number of input', () => {
cy.get('input[type=file]').should('have.length', 1);
});

it('Good name for upload a file button', () => {
cy.get('#ipc-dashboard-deploy-program-modal-button').should('contain', 'Deploy program');
});

it('Good name for close button', () => {
cy.get('#ipc-modal-close-button').should('contain', 'Close');
});
});

0 comments on commit d87237d

Please sign in to comment.