Skip to content

Commit b197105

Browse files
committed
test: Add unit test for rendering M+ exact mass in MS layout for InfoPanel
1 parent c8709f7 commit b197105

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

src/__tests__/units/components/panel/info.test.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,44 @@ describe("<InfoPanel />", () => {
7878
const {queryByTestId} = render(renderer);
7979
expect(queryByTestId('PanelInfo')).toBeInTheDocument();
8080
});
81+
82+
test('Render M+ exact mass for MS layout', () => {
83+
const msStore = mockStore({
84+
curve: {
85+
listCurves: [{feature: {}}],
86+
curveIdx: 0
87+
},
88+
layout: LIST_LAYOUT.MS,
89+
shift: {
90+
shifts: [],
91+
},
92+
simulation: [],
93+
detector: {
94+
curves: [
95+
{
96+
curveIdx: 0,
97+
selectedDetector: { name: 'Refractive index', label: 'RI' },
98+
},
99+
],
100+
},
101+
meta: {}
102+
});
103+
104+
const renderer =
105+
<AppWrapper store={msStore}>
106+
<ThemeProvider theme={theme}>
107+
<InfoPanel
108+
expand={false}
109+
onExapnd={() => {}}
110+
feature={feature}
111+
exactMass="121.0653"
112+
/>
113+
</ThemeProvider>
114+
</AppWrapper>
115+
;
116+
117+
render(renderer);
118+
119+
expect(screen.getByText('121.064751 g/mol')).toBeInTheDocument();
120+
});
81121
});

0 commit comments

Comments
 (0)