Skip to content

Commit

Permalink
last few spots using the state rep
Browse files Browse the repository at this point in the history
  • Loading branch information
karla-vm committed Jan 5, 2024
1 parent 0bc7c57 commit 9e99658
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 46 deletions.
24 changes: 0 additions & 24 deletions services/ui-src/src/components/app/AppRoutes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
mockBannerStore,
mockLDFlags,
mockStateUserStore,
mockStateUserStoreNoReports,
} from "utils/testing/setupJest";
// verbiage
import notFoundVerbiage from "verbiage/pages/not-found";
Expand Down Expand Up @@ -131,26 +130,3 @@ describe("Test AppRoutes for MCPAR report-specific routes", () => {
expect(currentPath).toEqual("/mcpar");
});
});

describe("Test AppRoutes for state users without report-specific access", () => {
beforeEach(async () => {
window.HTMLElement.prototype.scrollIntoView = function () {};
mockedUseStore.mockReturnValue({
...mockStateUserStoreNoReports,
...mockBannerStore,
});
history = createMemoryHistory();
history.push("/mlr");
await act(async () => {
mockLDFlags.set({ mlrReport: true });
await render(appRoutesComponent(history));
});
});
afterEach(async () => {
window.HTMLElement.prototype.scrollIntoView = tempScroll;
});
test("/mlr is not visible for state user without access", async () => {
const currentPath = history.location.pathname;
expect(currentPath).toEqual("/");
});
});
7 changes: 0 additions & 7 deletions services/ui-src/src/components/cards/TemplateCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { TemplateCard } from "components";
import {
mockLDFlags,
mockStateUserStore,
mockStateUserStoreNoReports,
RouterWrappedComponent,
} from "utils/testing/setupJest";
import { useStore } from "utils";
Expand Down Expand Up @@ -85,12 +84,6 @@ describe("Test MCPAR TemplateCard", () => {
const expectedRoute = mcparTemplateVerbiage.link.route;
await expect(mockUseNavigate).toHaveBeenCalledWith(expectedRoute);
});

test("'Enter MCPAR' button is disabled for user with no access to this report", async () => {
mockedUseStore.mockReturnValue(mockStateUserStoreNoReports);
const templateCardLink = screen.getByText(mcparTemplateVerbiage.link.text)!;
expect(templateCardLink).toBeDisabled;
});
});

describe("Test mlrReport feature flag functionality", () => {
Expand Down
15 changes: 0 additions & 15 deletions services/ui-src/src/utils/testing/mockZustand.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,6 @@ export const mockNoUserStore: McrUserState = {
setShowLocalLogins: () => {},
};

export const mockStateUserStoreNoReports: McrUserState = {
user: {
userRole: UserRoles.STATE_USER,
email: "[email protected]",
given_name: "Thelonious",
family_name: "States",
full_name: "Thelonious States",
state: "MN",
userIsEndUser: true,
},
showLocalLogins: true,
setUser: () => {},
setShowLocalLogins: () => {},
};

export const mockStateUserStore: McrUserState = {
user: {
userRole: UserRoles.STATE_USER,
Expand Down

0 comments on commit 9e99658

Please sign in to comment.