Skip to content

Commit

Permalink
781 flatten code base file structure (#786)
Browse files Browse the repository at this point in the history
* feat: added terms and conditions page

* feat: update package-lock for failing cypress tests

* chore: update reactour version

* fix: failing tests

* fix: removed unsused tour (for now)

* fix: added level-group for base-studies requests

* feat: restructure

* feat: added route checking

* fix: tests
  • Loading branch information
nicoalee authored Jul 22, 2024
1 parent beb3d5c commit 9e34c88
Show file tree
Hide file tree
Showing 351 changed files with 2,392 additions and 2,875 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export {};

const PATH = '/base-studies/mock-study-id';
const PAGE_NAME = 'StudyPage';
const PAGE_NAME = 'BaseStudyPage';

describe(PAGE_NAME, () => {
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export {};

const PATH = '/projects/abc123/extraction/studies/mock-study-id';
const PATH = '/projects/abc123/extraction/studies/mock-study-id/edit';
const PAGE_NAME = 'EditStudyPage';

describe(PAGE_NAME, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export {};

const PATH = '/projects/abc123/meta-analyses/mock-meta-analysis-id';
const PATH = '/meta-analyses/mock-meta-analysis-id';
const PAGE_NAME = 'MetaAnalysisPage';

describe(PAGE_NAME, () => {
Expand All @@ -15,9 +15,10 @@ describe(PAGE_NAME, () => {
cy.intercept('GET', `**/api/meta-analyses/**`, { fixture: 'metaAnalysis' }).as(
'metaAnalysisFixture'
);
cy.intercept('GET', `**/api/projects/*`, { fixture: 'projects/project' }).as(
'projectFixture'
);
cy.fixture('projects/project').then((project) => {
project.public = true;
cy.intercept('GET', `**/api/projects/*`, project).as('projectFixture');
});
cy.intercept('GET', `**/api/annotations/*`, { fixture: 'annotation' }).as(
'annotationFixture'
);
Expand All @@ -26,9 +27,9 @@ describe(PAGE_NAME, () => {

it('should load successfully', () => {
cy.visit(PATH)
.wait('@specificationFixture')
.wait('@metaAnalysisFixture')
.wait('@projectFixture')
.wait('@specificationFixture')
.wait('@annotationFixture')
.wait('@studysetFixture');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ describe('NotFoundPage', () => {

it('should display not found when the page is not found', () => {
cy.visit('/page-that-doesnt-exist');
cy.contains('Requested resource not found');
cy.contains('Not found');
});
});
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
/// <reference types="cypress" />

import { mockMetaAnalyses } from 'testing/mockData';

export {};

const PATH = '/meta-analyses';
const PAGE_NAME = 'MetaAnalysesPage';
const PATH = '/projects/abc123/meta-analyses/mock-meta-analysis-id';
const PAGE_NAME = 'ProjectMetaAnalysesPage';

describe.skip(PAGE_NAME, () => {
describe(PAGE_NAME, () => {
beforeEach(() => {
cy.clearLocalStorage().clearSessionStorage();
cy.intercept('GET', 'https://api.appzi.io/**', { fixture: 'appzi' }).as('appziFixture');
cy.intercept('GET', `**/api/specifications/**`, { fixture: 'specification' }).as(
'specificationFixture'
);
cy.intercept('GET', `**/api/meta-analyses/**`, { fixture: 'metaAnalysis' }).as(
'metaAnalysisFixture'
);
cy.fixture('projects/project').then((project) => {
project.public = true;
cy.intercept('GET', `**/api/projects/*`, project).as('projectFixture');
});
cy.intercept('GET', `**/api/annotations/*`, { fixture: 'annotation' }).as(
'annotationFixture'
);
cy.intercept('GET', `**/api/studysets/*`, { fixture: 'studyset' }).as('studysetFixture');
});

it('should load successfully', () => {
cy.intercept('GET', `**/api${PATH}*`).as('realMetaAnalysesRequest');
cy.visit(PATH).wait('@realMetaAnalysesRequest');
cy.visit(PATH)
.wait('@metaAnalysisFixture')
.wait('@projectFixture')
.wait('@specificationFixture')
.wait('@annotationFixture')
.wait('@studysetFixture');
});

// describe('Tour ', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ describe('ImportStudiesDialog', () => {
});

it('should load the page', () => {
cy.visit('/projects/abc123/curation').wait('@projectFixture').wait('@studysetFixture');
cy.login('mocked')
.visit('/projects/abc123/curation')
.wait('@projectFixture')
.wait('@studysetFixture');
});

it('should open the import studies dialog', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline';
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
import { ButtonGroup } from '@mui/material';
import NavToolbarStyles from 'components/Navbar/NavToolbar/NavToolbar.styles';
import NeurosynthPopupMenu from 'components/NeurosynthPopupMenu/NeurosynthPopupMenu';
import NavToolbarStyles from 'components/Navbar/NavToolbar.styles';
import NeurosynthPopupMenu from 'components/NeurosynthPopupMenu';
import { useRef } from 'react';
import LoadingButton from '../LoadingButton/LoadingButton';
import LoadingButton from 'components/Buttons/LoadingButton';
import { useCreateProject } from 'hooks';
import { generateNewProjectData } from 'pages/Projects/ProjectPage/ProjectStore.helpers';
import { generateNewProjectData } from 'pages/Project/store/ProjectStore.helpers';
import { useNavigate } from 'react-router-dom';

const CreateProjectButton: React.FC = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, ButtonProps } from '@mui/material';
import ProgressLoader from 'components/ProgressLoader/ProgressLoader';
import ProgressLoader from 'components/ProgressLoader';
import { ColorOptions } from 'index';

const LoadingButton: React.FC<
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
import { ChangeEvent, useEffect, useState } from 'react';
import LoadingButton from 'components/Buttons/LoadingButton/LoadingButton';
import LoadingButton from 'components/Buttons/LoadingButton';

export interface ICreateDetailsDialog {
isOpen: boolean;
Expand Down
Loading

0 comments on commit 9e34c88

Please sign in to comment.