forked from hms-dbmi-cellenics/ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hms-dbmi-cellenics#946 from biomage-org/cleanup-ui
Cleanup UI
- Loading branch information
Showing
89 changed files
with
840 additions
and
1,535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/__test__/components/data-management/ProjectSearchBox.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
src/__test__/components/data-processing/PlotLayout.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import userEvent from '@testing-library/user-event'; | ||
import { Provider } from 'react-redux'; | ||
import thunk from 'redux-thunk'; | ||
import configureStore from 'redux-mock-store'; | ||
import PlotLayout from 'components/data-processing/PlotLayout'; | ||
import '__test__/test-utils/setupTests'; | ||
|
||
// Mock data and store setup | ||
const experimentId = 'exp1'; | ||
const sampleId = 'sample1'; | ||
const sampleIds = ['sample1', 'sample2']; | ||
const filterName = 'testFilter'; | ||
const filterTableUuid = 'filterTableUuid1'; | ||
const plots = { | ||
plot1: { | ||
plotUuid: 'plotUuid1', | ||
plot: jest.fn(), | ||
plotType: 'type1', | ||
}, | ||
plot2: { | ||
plotUuid: 'plotUuid2', | ||
plot: jest.fn(), | ||
plotType: 'type2', | ||
}, | ||
}; | ||
const mockStore = configureStore([thunk]); | ||
const initialState = { | ||
componentConfig: { | ||
plotUuid1: { config: {}, plotData: {} }, | ||
plotUuid2: { config: {}, plotData: {} }, | ||
filterTableUuid1: { plotData: {} }, | ||
}, | ||
experimentSettings: { | ||
processing: { | ||
[filterName]: { | ||
[sampleId]: { filterSettings: {} }, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
const renderComponent = (store) => render( | ||
<Provider store={store}> | ||
<PlotLayout | ||
experimentId={experimentId} | ||
plots={plots} | ||
filterName={filterName} | ||
filterTableUuid={filterTableUuid} | ||
sampleId={sampleId} | ||
sampleIds={sampleIds} | ||
onConfigChange={jest.fn()} | ||
stepDisabled={false} | ||
plotStylingControlsConfig={[]} | ||
renderCalculationConfig={() => <div />} | ||
stepHadErrors={false} | ||
allowedPlotActions={{}} | ||
/> | ||
</Provider>, | ||
); | ||
|
||
describe('PlotLayout', () => { | ||
let store; | ||
|
||
beforeEach(() => { | ||
store = mockStore(initialState); | ||
}); | ||
|
||
it('renders without crashing', () => { | ||
renderComponent(store); | ||
expect(screen.getByText('Filtering Settings')).toBeInTheDocument(); | ||
}); | ||
|
||
it('changes selected plot on mini plot click', () => { | ||
renderComponent(store); | ||
const miniPlotButton = screen.getAllByRole('button')[0]; | ||
userEvent.click(miniPlotButton); | ||
expect(plots.plot1.plot).toHaveBeenCalled(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.