Skip to content

Commit

Permalink
fix analyses tests based on updated code
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwiniHerle committed Oct 8, 2024
1 parent d53e2b5 commit 03c3136
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ import {
describe, it, beforeEach, afterEach
} from 'mocha';

import {
Accordion,
Button,
} from 'react-bootstrap';
import { Button } from 'react-bootstrap';

import ReactionDetailsContainers from 'src/apps/mydb/elements/details/reactions/analysesTab/ReactionDetailsContainers';

import AccordionHeaderWithButtons from 'src/components/common/AccordionHeaderWithButtons';
import Reaction from 'src/models/Reaction';
import Container from 'src/models/Container';

Expand Down Expand Up @@ -55,15 +52,14 @@ describe('ReactionDetailsContainers', () => {
<ReactionDetailsContainers reaction={reaction} readOnly={false} />
);

expect(wrapper.text()).toEqual(expect.stringContaining(
`${analysis.name} - Type: ${analysis.extended_metadata.kind}`
));
const deletedHeader = wrapper.find(AccordionHeaderWithButtons).shallow().find('strike');
expect(deletedHeader.text()).toContain(analysis.name);

const button = wrapper.find(Accordion.Header).find(Button);
const button = wrapper.find(AccordionHeaderWithButtons).find(Button);
expect(button.html()).toEqual(shallow(
<Button
className="ml-auto"
size="sm"
className="ms-auto"
size="xsm"
variant="danger"
>
<i className="fa fa-undo" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import {
describe, it, beforeEach, afterEach
} from 'mocha';

import {
Accordion,
Button,
} from 'react-bootstrap';
import { Button } from 'react-bootstrap';

import Container from 'src/models/Container';
import ResearchPlan from 'src/models/ResearchPlan';
import AccordionHeaderWithButtons from 'src/components/common/AccordionHeaderWithButtons';

import ResearchPlanDetailsContainers
from 'src/apps/mydb/elements/details/researchPlans/analysesTab/ResearchPlanDetailsContainers';
Expand Down Expand Up @@ -56,15 +54,14 @@ describe('ResearchPlanDetailsContainers', () => {
<ResearchPlanDetailsContainers researchPlan={researchPlan} readOnly={false} />
);

expect(wrapper.text()).toEqual(expect.stringContaining(
`${analysis.name} - Type: ${analysis.extended_metadata.kind}`
));
const deletedHeader = wrapper.find(AccordionHeaderWithButtons).shallow().find('strike');
expect(deletedHeader.text()).toContain(analysis.name);

const button = wrapper.find(Accordion.Header).find(Button);
const button = wrapper.find(AccordionHeaderWithButtons).find(Button);
expect(button.html()).toEqual(shallow(
<Button
className="ml-auto"
size="sm"
className="ms-auto"
size="xsm"
variant="danger"
>
<i className="fa fa-undo" />
Expand Down

0 comments on commit 03c3136

Please sign in to comment.