-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New] Added test cases for record list add record menu #332
[New] Added test cases for record list add record menu #332
Conversation
0211087
to
a407855
Compare
|
||
}); | ||
|
||
it("opens a <CreateRecordDialog /> if module allow_searchable_ids", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to test if the CreateRecordDialog
is open.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
done(); | ||
}); | ||
|
||
it("renders record view modal", done => { | ||
expect(component.find(ViewModal)).to.have.lengthOf(1); | ||
mountedComponent(<RecordList />,initialState, ["/cases"]) | ||
expect(screen.getAllByText('messages.record_list.rows_per_page')).toHaveLength(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to test if the ViewModal
was rendered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
expect(component.find(ViewModal).props().openViewModal).to.be.true; | ||
mountedComponent(<RecordList />,initialState, ["/cases"]) | ||
expect(screen.getAllByText('messages.record_list.rows_per_page')).toHaveLength(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This no longer performs a click and doesn't seem to test if the ViewModal was opened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
expect(component.find(ViewModal).props().openViewModal).to.be.false; | ||
mountedComponent(<RecordList />,initialState.setIn(["application", "online"], false), ["/cases"]) | ||
expect(screen.getByTestId('filters')).toBeInTheDocument() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is supposed to check that the view modal was not opened, but this code checks for filters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
}); | ||
}); | ||
|
||
describe("when age is 0", () => { | ||
it("renders a 0 in the cell ", () => { | ||
expect(component.find(TableRow).at(1).find(TableCell).at(2).find(ConditionalWrapper).text()).to.equal("0"); | ||
mountedComponent(<RecordList />,initialState.setIn(["application", "online"], false), ["/cases"]) | ||
expect(screen.getAllByText('0-0 messages.record_list.of 0')).toHaveLength(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this is checking the pagination.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To check if the rows are empty
c03a72a
to
8529c5a
Compare
8529c5a
to
ea5a6ff
Compare
386ad20
into
primeroIMS:develop_react_upgrade
Added test cases for record list add record menu component