Skip to content

Commit

Permalink
Merge pull request #200 from CBIIT/CRDCDH-575
Browse files Browse the repository at this point in the history
update submission req icons
  • Loading branch information
amattu2 authored Nov 8, 2023
2 parents 2fdef27 + 56d8edf commit 84f4188
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 28 deletions.
18 changes: 2 additions & 16 deletions src/components/StatusBar/StatusBar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Approved from './icons/Approved.svg';
import Rejected from './icons/Rejected.svg';
import Submitted from './icons/Submitted.svg';
import UnderReview from './icons/UnderReview.svg';
import InProgress from './icons/InProgress.svg';
import { FormatDate } from "../../utils";

type Props = {
Expand Down Expand Up @@ -328,22 +329,7 @@ describe("StatusBar > History Modal Tests", () => {
expect(() => getByTestId("status-bar-history-item-1-icon")).toThrow();
});

const noIconStatuses = ["In Progress"];
it.each(noIconStatuses)("does not render an icon for status %s", (status) => {
const data = {
history: [{ dateTime: "2023-11-24T01:25:45Z", status }],
};

const { getByTestId, getByText } = render(<BaseComponent data={data} />);

act(() => {
fireEvent.click(getByText("Full History"));
});

expect(() => getByTestId("status-bar-history-item-0-icon")).toThrow();
});

const statusesWithIcons = [["New", New], ["Submitted", Submitted], ["Approved", Approved], ["Rejected", Rejected], ["In Review", UnderReview]];
const statusesWithIcons = [["New", New], ["Submitted", Submitted], ["Approved", Approved], ["Rejected", Rejected], ["In Review", UnderReview], ["In Progress", InProgress]];
it.each(statusesWithIcons)("renders the correct icon for the status %s", (status, svg) => {
const data = {
history: [{ dateTime: "2023-11-24T01:25:45Z", status }],
Expand Down
25 changes: 25 additions & 0 deletions src/components/StatusBar/icons/InProgress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 21 additions & 8 deletions src/components/StatusBar/icons/New.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 19 additions & 4 deletions src/components/StatusBar/icons/Submitted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/StatusBar/icons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Approved from "./Approved.svg";
import UnderReview from "./UnderReview.svg";
import StatusApproved from "./StatusApproved.svg";
import StatusRejected from "./StatusRejected.svg";
import InProgress from "./InProgress.svg";

export type IconType = {
[key: string]: string;
Expand All @@ -21,6 +22,7 @@ export const HistoryIconMap : IconType = {
Rejected,
Approved,
"In Review": UnderReview,
"In Progress": InProgress,
};

/**
Expand Down

0 comments on commit 84f4188

Please sign in to comment.