Skip to content

Commit

Permalink
Merge pull request #360 from MeasureAuthoringTool/MAT-7525_madie-edit…
Browse files Browse the repository at this point in the history
…or-vulnerability

Mat 7525 madie editor vulnerability
  • Loading branch information
sb-cecilialiu authored Oct 15, 2024
2 parents 513f077 + feb3489 commit f66e600
Show file tree
Hide file tree
Showing 8 changed files with 3,817 additions and 1,947 deletions.
5,720 changes: 3,799 additions & 1,921 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
"dependencies": {
"@madie/cql-antlr-parser": "^1.0.4",
"@madie/madie-design-system": "^1.2.31",
"@madie/madie-design-system": "^1.2.37",
"@material-ui/core": "^4.12.4",
"@mui/icons-material": "^5.5.1",
"@mui/lab": "^5.0.0-alpha.73",
Expand All @@ -88,7 +88,7 @@
"single-spa": "^5.9.3",
"single-spa-react": "^4.6.1",
"styled-components": "^5.3.3",
"tailwindcss": "^3.0.23",
"tailwindcss": "^3.4.13",
"twin.macro": "^3.4.0",
"yup": "^1.4.0"
},
Expand Down
16 changes: 8 additions & 8 deletions src/CqlBuilderPanel/CqlBuilderPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ describe("CqlBuilderPanel", () => {

const typeSelect = screen.getByTestId("type-selector");
const typeSelectDropdown = within(typeSelect).getByRole(
"button"
"combobox"
) as HTMLInputElement;
userEvent.click(typeSelectDropdown);

Expand Down Expand Up @@ -293,7 +293,7 @@ describe("CqlBuilderPanel", () => {

const typeSelect = screen.getByTestId("type-selector");
const typeSelectDropdown = within(typeSelect).getByRole(
"button"
"combobox"
) as HTMLInputElement;
userEvent.click(typeSelectDropdown);

Expand Down Expand Up @@ -370,7 +370,7 @@ describe("CqlBuilderPanel", () => {

const typeSelect = screen.getByTestId("type-selector");
const typeSelectDropdown = within(typeSelect).getByRole(
"button"
"combobox"
) as HTMLInputElement;
userEvent.click(typeSelectDropdown);

Expand Down Expand Up @@ -417,7 +417,7 @@ describe("CqlBuilderPanel", () => {

const typeSelect = screen.getByTestId("type-selector");
const typeSelectDropdown = within(typeSelect).getByRole(
"button"
"combobox"
) as HTMLInputElement;
userEvent.click(typeSelectDropdown);

Expand Down Expand Up @@ -463,7 +463,7 @@ describe("CqlBuilderPanel", () => {

const typeSelect = screen.getByTestId("type-selector");
const typeSelectDropdown = within(typeSelect).getByRole(
"button"
"combobox"
) as HTMLInputElement;
userEvent.click(typeSelectDropdown);

Expand Down Expand Up @@ -512,7 +512,7 @@ describe("CqlBuilderPanel", () => {

const typeSelect = screen.getByTestId("type-selector");
const typeSelectDropdown = within(typeSelect).getByRole(
"button"
"combobox"
) as HTMLInputElement;
userEvent.click(typeSelectDropdown);

Expand Down Expand Up @@ -560,7 +560,7 @@ describe("CqlBuilderPanel", () => {

const typeSelect = screen.getByTestId("type-selector");
const typeSelectDropdown = within(typeSelect).getByRole(
"button"
"combobox"
) as HTMLInputElement;
userEvent.click(typeSelectDropdown);

Expand Down Expand Up @@ -607,7 +607,7 @@ describe("CqlBuilderPanel", () => {

const typeSelect = screen.getByTestId("type-selector");
const typeSelectDropdown = within(typeSelect).getByRole(
"button"
"combobox"
) as HTMLInputElement;
userEvent.click(typeSelectDropdown);

Expand Down
6 changes: 3 additions & 3 deletions src/CqlBuilderPanel/Includes/Search/LibrarySearch.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe("LibrarySearch component tests", () => {
const searchBtn = screen.getByTestId("search-btn");
userEvent.click(searchBtn);

const limitChangeButton = await screen.findByRole("button", {
const limitChangeButton = await screen.findByRole("combobox", {
expanded: false,
});
expect(limitChangeButton).toBeInTheDocument();
Expand Down Expand Up @@ -184,7 +184,7 @@ describe("LibrarySearch component tests", () => {
});
const versionSelect = screen.getByTestId("version-select");
// Change the version
userEvent.click(await within(versionSelect).getByRole("button"));
userEvent.click(await within(versionSelect).getByRole("combobox"));
const versionOptions = await screen.findAllByRole("option");
expect(versionOptions.length).toBe(3);
// select 2nd option
Expand Down Expand Up @@ -248,7 +248,7 @@ describe("LibrarySearch component tests", () => {
mockCqlLibraries[0].librarySet.owner
);
// Change the version
userEvent.click(await within(versionSelect).getByRole("button"));
userEvent.click(await within(versionSelect).getByRole("combobox"));
const versionOptions = await screen.findAllByRole("option");
expect(versionOptions.length).toBe(3);
// select 2nd option
Expand Down
4 changes: 2 additions & 2 deletions src/CqlBuilderPanel/ValueSets/Results/Results.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ describe("Results pagination", () => {
filteredValueSets={mockValueSetResults}
/>
);
const limitChangeButton = await findByRole("button", { expanded: false });
const limitChangeButton = await findByRole("combobox", { expanded: false });
expect(limitChangeButton).toBeInTheDocument();
userEvent.click(limitChangeButton);
const options = await findAllByRole("option");
Expand Down Expand Up @@ -266,7 +266,7 @@ describe("Results pagination", () => {
/>
);
// select limit as 25 items;
const limitChangeButton = await findByRole("button", { expanded: false });
const limitChangeButton = await findByRole("combobox", { expanded: false });
expect(limitChangeButton).toBeInTheDocument();
userEvent.click(limitChangeButton);
const options = await findAllByRole("option");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,8 @@ describe("Code Section component", () => {
const comboBoxContainer = screen.getByTestId(
"code-system-version-selector"
);
const codeSystemVersionSelect = within(comboBoxContainer).getByRole(
"button",
{
name: "Code System Version HL7V3.0_2019-02",
}
);
const codeSystemVersionSelect =
within(comboBoxContainer).getByRole("combobox");
expect(codeSystemVersionSelect).toHaveTextContent("HL7V3.0_2019-02");
expect(codeSystemVersionSelect).toBeEnabled();
userEvent.click(codeSystemVersionSelect);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ describe("DefinitionsSection", () => {
expect(savedDefinitions).toHaveAttribute("aria-selected", "true");
});

const limitChoice = await screen.findByRole("button", {
name: /5/i,
});
const limitChoice = await screen.findByRole("combobox");

expect(limitChoice).toHaveTextContent("5");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ describe("CqlEditorWithTerminology component", () => {
};
render(<CqlEditorWithTerminology {...props} />);

expect(screen.getByTestId("split-view-view")).toBeInTheDocument();
expect(screen.getByTestId("expanded-button")).toBeInTheDocument();
expect(screen.queryByTestId("valueSets-tab")).not.toBeInTheDocument();
});
Expand Down Expand Up @@ -97,7 +96,6 @@ describe("CqlEditorWithTerminology component", () => {
};
render(<CqlEditorWithTerminology {...props} />);

expect(screen.getByTestId("split-view-view")).toBeInTheDocument();
const expandBtn = screen.getByTestId("expanded-button");
expect(expandBtn).toBeInTheDocument();

Expand Down

0 comments on commit f66e600

Please sign in to comment.