Skip to content

Commit 5039554

Browse files
authored
fix issues in npm audit/dependabot (#599)
1 parent 15945a1 commit 5039554

File tree

37 files changed

+3773
-3335
lines changed

37 files changed

+3773
-3335
lines changed

.github/workflows/library.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Cache npm dependencies
2525
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
2626
with:
27-
node-version: 18.17.1
27+
node-version: 20
2828
cache: "npm"
2929

3030
- name: Install dependencies

apps/admin/public/mockServiceWorker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* - Please do NOT modify this file.
88
*/
99

10-
const PACKAGE_VERSION = '2.11.3'
10+
const PACKAGE_VERSION = '2.12.10'
1111
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
1212
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
1313
const activeClientIds = new Set()
@@ -205,6 +205,7 @@ async function resolveMainClient(event) {
205205
* @param {FetchEvent} event
206206
* @param {Client | undefined} client
207207
* @param {string} requestId
208+
* @param {number} requestInterceptedAt
208209
* @returns {Promise<Response>}
209210
*/
210211
async function getResponse(event, client, requestId, requestInterceptedAt) {

apps/app-orch/public/mockServiceWorker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* - Please do NOT modify this file.
88
*/
99

10-
const PACKAGE_VERSION = '2.11.3'
10+
const PACKAGE_VERSION = '2.12.10'
1111
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
1212
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
1313
const activeClientIds = new Set()
@@ -205,6 +205,7 @@ async function resolveMainClient(event) {
205205
* @param {FetchEvent} event
206206
* @param {Client | undefined} client
207207
* @param {string} requestId
208+
* @param {number} requestInterceptedAt
208209
* @returns {Promise<Response>}
209210
*/
210211
async function getResponse(event, client, requestId, requestInterceptedAt) {

apps/app-orch/src/components/atoms/ApplicationProfileOverrideValueComboBoxCell/ApplicationProfileOverrideValueComboBoxCell.cy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ describe("<ApplicationProfileOverrideValueComboBoxCell />", () => {
115115
);
116116

117117
pom.combobox.select("value1");
118-
pom.root.click(0, 0); //blur or go out of focus
118+
pom.combobox.root.find("input").focus().blur(); //blur or go out of focus
119119
const expectedValue = {
120120
"Model Size": "value1",
121121
};

apps/app-orch/src/components/atoms/ApplicationProfileParameterOverrideForm/ApplicationProfileParameterOverrideForm.cy.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { cyGet } from "@orch-ui/tests";
76
import { applicationOne, profileTwo } from "@orch-ui/utils";
87
import { setupStore } from "../../../store";
98
import { initialState } from "../../../store/reducers/setupDeployment";
@@ -100,7 +99,7 @@ describe("<ApplicationProfileParameterOverrideForm />", () => {
10099
);
101100

102101
pom.selectParam(0, "value1");
103-
cyGet("testHelper").click();
102+
pom.table.getRows().eq(0).find(".spark-combobox input").focus().blur();
104103
cy.window()
105104
.its("store")
106105
.invoke("getState")
@@ -113,7 +112,7 @@ describe("<ApplicationProfileParameterOverrideForm />", () => {
113112
});
114113

115114
pom.selectParam(1, "12");
116-
cyGet("testHelper").click();
115+
pom.table.getRows().eq(1).find(".spark-combobox input").focus().blur();
117116

118117
const expectedValueUpdate = {
119118
...expectedValue,
@@ -123,7 +122,7 @@ describe("<ApplicationProfileParameterOverrideForm />", () => {
123122
},
124123
};
125124
pom.typeParam(1, "value4");
126-
cyGet("testHelper").click();
125+
pom.table.getRows().eq(1).find(".spark-combobox input").focus().blur();
127126
cy.window()
128127
.its("store")
129128
.invoke("getState")

apps/app-orch/src/components/organisms/applications/ApplicationSource/ApplicationSource.cy.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ describe("<ApplicationSource />", () => {
8585
validVersions.forEach((version) => {
8686
it(`should accept valid versionPattern: "${version}"`, () => {
8787
// Type version and check for valid state
88-
pom.el.chartVersionCombobox.first().clear().type(version);
88+
pom.el.chartVersionCombobox.find("input").first().clear().type(version);
8989
cy.contains("Invalid version").should("not.exist");
9090
});
9191
});
9292

9393
invalidVersions.forEach((version) => {
9494
it(`should reject invalid versionPattern: "${version}"`, () => {
95-
pom.el.chartVersionCombobox.first().clear().type(version);
95+
pom.el.chartVersionCombobox.find("input").first().clear().type(version);
9696
cy.contains("Invalid version").should("exist");
9797
});
9898
});

apps/app-orch/src/components/organisms/deployments/DeploymentUpgradeModal/DeploymentUpgradeModal.cy.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import DeploymentUpgradeModal from "./DeploymentUpgradeModal";
1010
import { DeploymentUpgradeModalPom } from "./DeploymentUpgradeModal.pom";
1111

1212
const pom = new DeploymentUpgradeModalPom();
13+
14+
// Use empty appVersion so the Combobox filter (contains) shows all versions in dropdown
15+
const deployment = { ...deployments.deployments[0], appVersion: "" };
16+
1317
describe("Deployments Upgrade modal", () => {
1418
describe("when selecting the latest version", () => {
1519
beforeEach(() => {
@@ -18,12 +22,12 @@ describe("Deployments Upgrade modal", () => {
1822
<DeploymentUpgradeModal
1923
isOpen
2024
setIsOpen={() => {}}
21-
deployment={deployments.deployments[0]}
25+
deployment={deployment}
2226
/>,
2327
);
2428
pom.waitForApis();
2529
pom.el.selectDeploymentVersion.find("button").click();
26-
cy.get("[data-key='3.0.0']").click();
30+
cy.get(".spark-popover").contains("3.0.0").click();
2731
});
2832
it("upgrade", () => {
2933
pom.interceptApis([pom.api.postUpgradeDeploymentsList]);
@@ -62,7 +66,7 @@ describe("Deployments Upgrade modal", () => {
6266
setIsOpen={(isOpen) => {
6367
setIsOpen(isOpen);
6468
}}
65-
deployment={deployments.deployments[0]}
69+
deployment={deployment}
6670
/>
6771
) : (
6872
<div data-cy="isClosed">Modal is closed</div>
@@ -75,7 +79,7 @@ describe("Deployments Upgrade modal", () => {
7579
});
7680
it("should invoke the callback on cancel", () => {
7781
pom.el.selectDeploymentVersion.find("button").click();
78-
cy.get("[data-key='3.0.0']").click();
82+
cy.get(".spark-popover").contains("3.0.0").click();
7983
pom.el.cancelBtn.click();
8084
cyGet("isClosed").should("contain.text", "Modal is closed");
8185
});
@@ -84,7 +88,7 @@ describe("Deployments Upgrade modal", () => {
8488
});
8589
it("should upgrade a deployment and invoke the callback", () => {
8690
pom.el.selectDeploymentVersion.find("button").click();
87-
cy.get("[data-key='3.0.0']").click();
91+
cy.get(".spark-popover").contains("3.0.0").click();
8892

8993
pom.el.upgradeBtn.should("not.have.class", "spark-button-disabled");
9094

apps/app-orch/src/components/organisms/deployments/DeploymentsTable/DeploymentsTable.cy.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,16 @@ describe("<DeploymentsTable />", () => {
138138
pom.interceptApis([pom.api.getDeploymentsList]);
139139
cy.mount(<DeploymentsTable hasPermission={false} />);
140140
pom.waitForApis();
141-
pom.el.addDeploymentButton.should("have.attr", "aria-disabled", "true");
141+
pom.el.addDeploymentButton.should("have.class", "spark-button-disabled");
142142
});
143143

144144
it("enable action button when authorized", () => {
145145
pom.interceptApis([pom.api.getDeploymentsList]);
146146
cy.mount(<DeploymentsTable hasPermission={true} />);
147147
pom.waitForApis();
148148
pom.el.addDeploymentButton.should(
149-
"not.have.attr",
150-
"aria-disabled",
151-
"true",
149+
"not.have.class",
150+
"spark-button-disabled",
152151
);
153152
});
154153

apps/app-orch/src/components/organisms/profiles/ParameterOverridesForm/ParameterOverridesForm.cy.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ describe("<ParameterOverridesForm/>", () => {
8686
pom.root.should("not.contain.text", "Unique name required");
8787
pom.el.defaultValue.should("have.value", "testValue1");
8888
flagsPom.selectComboboxItem(3);
89+
flagsPom.root.find("input").focus().blur();
8990
pom.el.suggestedValue.click();
9091
pom.el.defaultValue.should("have.value", "");
9192
cy.get("@onUpdateStub").should("have.been.calledWith", [

apps/app-orch/src/components/pages/SetupDeployment/SetupDeployment.cy.tsx

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe("<SetupDeployment>", () => {
7373
"contain.text",
7474
"There are no Deployment Packages currently available.",
7575
);
76-
pom.el.nextBtn.should("have.attr", "aria-disabled", "true");
76+
pom.el.nextBtn.should("have.class", "spark-button-disabled");
7777
});
7878
});
7979

@@ -90,7 +90,7 @@ describe("<SetupDeployment>", () => {
9090
});
9191

9292
it("should disable Next Button before package selection", () => {
93-
pom.el.nextBtn.should("have.attr", "aria-disabled", "true");
93+
pom.el.nextBtn.should("have.class", "spark-button-disabled");
9494
});
9595

9696
it("should contain list of multiple deployment package", () => {
@@ -113,7 +113,7 @@ describe("<SetupDeployment>", () => {
113113
pom.selectProfile.emptyPom.el.emptySubTitle.contains(
114114
"No Deployment Profiles found.",
115115
);
116-
pom.el.nextBtn.should("have.attr", "aria-disabled", "true");
116+
pom.el.nextBtn.should("have.class", "spark-button-disabled");
117117
});
118118
});
119119

@@ -135,7 +135,7 @@ describe("<SetupDeployment>", () => {
135135
.getRowBySearchText(packageWithParameterTemplates.defaultProfileName!)
136136
.find("[data-cy='radioButtonCy']")
137137
.should("be.checked");
138-
pom.el.nextBtn.should("have.attr", "aria-disabled", "false");
138+
pom.el.nextBtn.should("not.have.class", "spark-button-disabled");
139139
});
140140
describe("w/o override parameter", () => {
141141
beforeEach(() => {
@@ -268,19 +268,17 @@ describe("<SetupDeployment>", () => {
268268
.getRows()
269269
.eq(0)
270270
.find(".spark-combobox input")
271-
.should("not.be.disabled");
272-
273-
pom.OverrideProfileValues.overrideTable.overrideForm.table
274-
.getRows()
275-
.eq(0)
276-
.find(".spark-combobox input")
277-
.clear();
278-
279-
pom.OverrideProfileValues.overrideTable.overrideForm.table
280-
.getRows()
281-
.eq(0)
282-
.find(".spark-combobox input")
283-
.type("222");
271+
.should("not.be.disabled")
272+
.clear()
273+
.should("have.value", "")
274+
.type("222", { delay: 100 })
275+
.should("have.value", "222")
276+
.then(($input) => {
277+
// Dispatch focusout (which React delegates onBlur from) to commit value to Redux
278+
$input[0].dispatchEvent(
279+
new FocusEvent("focusout", { bubbles: true }),
280+
);
281+
});
284282
});
285283

286284
it(
@@ -345,7 +343,7 @@ describe("<SetupDeployment>", () => {
345343
pom.interceptApis([pom.api.postDeploymentMocked]);
346344
pom.el.nextBtn.click().as("postClick");
347345
//To avoid mutliple deploy request , Check if deploy button is disabled after click
348-
cy.get("@postClick").should("have.attr", "aria-disabled", "true");
346+
cy.get("@postClick").should("have.class", "spark-button-disabled");
349347
pom.waitForApis();
350348

351349
cy.get(`@${pom.api.postDeploymentMocked}`)

0 commit comments

Comments
 (0)