|
No visits found with current filtering
diff --git a/test/visits/VisitsTable.test.tsx b/test/visits/VisitsTable.test.tsx
index a2d01c4a..393ab64d 100644
--- a/test/visits/VisitsTable.test.tsx
+++ b/test/visits/VisitsTable.test.tsx
@@ -10,13 +10,14 @@ describe('', () => {
const matchMedia = () => Mock.of({ matches: false });
const setSelectedVisits = jest.fn();
let wrapper: ShallowWrapper;
- const createWrapper = (visits: NormalizedVisit[], selectedVisits: NormalizedVisit[] = []) => {
+ const createWrapper = (visits: NormalizedVisit[], selectedVisits: NormalizedVisit[] = [], isOrphanVisits = false) => {
wrapper = shallow(
,
);
@@ -134,4 +135,17 @@ describe('', () => {
searchField.simulate('change', '');
expect(wrapper.find('tbody').find('tr')).toHaveLength(7 + 2);
});
+
+ it.each([
+ [ true, 8 ],
+ [ false, 7 ],
+ ])('displays proper amount of columns for orphan and non-orphan visits', (isOrphanVisits, expectedCols) => {
+ const wrapper = createWrapper([], [], isOrphanVisits);
+ const rowsWithColspan = wrapper.find('[colSpan]');
+ const cols = wrapper.find('th');
+
+ expect(cols).toHaveLength(expectedCols);
+ expect(rowsWithColspan).toHaveLength(2);
+ rowsWithColspan.forEach((row) => expect(row.prop('colSpan')).toEqual(expectedCols));
+ });
});
|