Skip to content

Commit

Permalink
Fix test regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
peterMuriuki committed Jul 31, 2024
1 parent 782f5b1 commit 07311d5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,3 @@ exports[`location-management/src/components/AllLocationListFlat Show data as exp
exports[`location-management/src/components/AllLocationListFlat Show data as expected: table data 5`] = `"Edit"`;

exports[`location-management/src/components/AllLocationListFlat Show data as expected: table header 1`] = `"NameParentPhysical TypeStatusActions"`;

exports[`location-management/src/components/AllLocationListFlat sort and filters work: table data 1`] = `"Good Health Clinic"`;

exports[`location-management/src/components/AllLocationListFlat sort and filters work: table data 2`] = `""`;

exports[`location-management/src/components/AllLocationListFlat sort and filters work: table data 3`] = `"Building"`;

exports[`location-management/src/components/AllLocationListFlat sort and filters work: table data 4`] = `"active"`;

exports[`location-management/src/components/AllLocationListFlat sort and filters work: table data 5`] = `"Edit"`;

exports[`location-management/src/components/AllLocationListFlat sort and filters work: table header 1`] = `"NameParentPhysical TypeStatusActions"`;
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe('location-management/src/components/AllLocationListFlat', () => {
_include: 'Location:partof',
_getpagesoffset: 0,
_count: 20,
_sort: '-name',
_sort: 'name',
})
.reply(200, flatLocations);
const nameSorterCaretDown = document.querySelector(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const EditLink: React.FC<EditLinkProps> = (props) => {

return (
<Link
data-testid="edit-child-location"
to={
isBuilding
? `${URL_SERVICE_POINT_ADD_EDIT}/${id}?${backToParam}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ test('works correctly - jurisdiction location', async () => {
return element.getAttribute('href');
});
expect(editLinks).toEqual([
'/admin/location/unit/edit/46bb8a3f-cf50-4cc2-b421-fe4f77c3e75d?back_to=%2Fprofile%2Fd9d7aa7b-7488-48e7-bae8-d8ac5bd09334',
'/admin/service-points/add-edit/46bb8a3f-cf50-4cc2-b421-fe4f77c3e75d?back_to=%2Fprofile%2Fd9d7aa7b-7488-48e7-bae8-d8ac5bd09334',
]);

// validate search works.
Expand Down Expand Up @@ -249,7 +249,7 @@ test('works correctly - physical location', async () => {

// check records shown in table.
let tableData = [...inventoryTab.querySelectorAll('table tbody tr')].map((tr) => tr.textContent);
expect(tableData).toEqual(['No data']);
expect(tableData).toEqual(['HealthEdit']);

// switch to inactive tab
const inactiveRadio = screen.getByRole('radio', { name: /Inactive/i });
Expand Down

0 comments on commit 07311d5

Please sign in to comment.