-
{
@@ -40,7 +40,7 @@ function Condition(props){
-
+
{((ValCtx.conditionFieldErrors) ? ValCtx.conditionFieldErrors.map((el) =>
{el}
) : )}
@@ -49,7 +49,7 @@ function Condition(props){
{((ValCtx.patternsExistErrors) ?
- {ValCtx.patternsExistErrors}
+ {ValCtx.patternsExistErrors}
: null)}
@@ -62,7 +62,7 @@ function Condition(props){
{((ValCtx.conditionalExistErrors) ?
- {ValCtx.conditionalExistErrors}
+ {ValCtx.conditionalExistErrors}
: null)}
diff --git a/frontend/packages/manager/src/components/profiles/Conditional.jsx b/frontend/packages/manager/src/components/profiles/Conditional.jsx
index c42808c..639c22a 100644
--- a/frontend/packages/manager/src/components/profiles/Conditional.jsx
+++ b/frontend/packages/manager/src/components/profiles/Conditional.jsx
@@ -108,43 +108,43 @@ function Conditional(props){
const keyID = createDOMID();
newIndices[`${keyID}`] = indexCopy;
return (
-
+
-
handleField(newIndices[`${keyID}`], e)}
+ handleField(newIndices[`${keyID}`], e)}
error={((ValCtx.conditionalFieldErrors && newIndices[`${keyID}`] in ValCtx.conditionalFieldErrors))}/>
{((ValCtx.conditionalFieldErrors && newIndices[`${keyID}`] in ValCtx.conditionalFieldErrors) ?
- ValCtx.conditionalFieldErrors[newIndices[`${keyID}`]].map((el) =>
- {el}
) : )}
+ ValCtx.conditionalFieldErrors[newIndices[`${keyID}`]].map((el, i) =>
+ {el}
) : )}
-
+
handleOperation(newIndices[`${keyID}`], value)} filter>
-
-
-
-
+
+
+
+
{
ProfCtx.conditional[newIndices[`${keyID}`]].operation === 'in' ? (
-
+
{((ValCtx.conditionalValuesExistErrors && newIndices[`${keyID}`] in ValCtx.conditionalValuesExistErrors) ?
- {ValCtx.conditionalValuesExistErrors[newIndices[`${keyID}`]]}
+ {ValCtx.conditionalValuesExistErrors[newIndices[`${keyID}`]]}
: null)}
) : (
-
handleValue(newIndices[`${keyID}`], e)}
+ handleValue(newIndices[`${keyID}`], e)}
error={((ValCtx.conditionalValuesErrors && newIndices[`${keyID}`] in ValCtx.conditionalValuesErrors
&& 0 in ValCtx.conditionalValuesErrors[newIndices[`${keyID}`]]))}/>
{((ValCtx.conditionalValuesErrors && newIndices[`${keyID}`] in ValCtx.conditionalValuesErrors
&& 0 in ValCtx.conditionalValuesErrors[newIndices[`${keyID}`]]) ?
- ValCtx.conditionalValuesErrors[newIndices[`${keyID}`]][0].map((el) =>
- {el}
) : )}
+ ValCtx.conditionalValuesErrors[newIndices[`${keyID}`]][0].map((el, i) =>
+ {el}
) : )}
)
}
@@ -168,7 +168,7 @@ function Conditional(props){
onRequestAdd={handleRequestAdd}
style={{ width: 300 }}
addLabel="Add condition"
- data-test="form:conditional-profile"
+ data-test="sc4snmp:form:add-conditional-profile"
>
{rowItems}
diff --git a/frontend/packages/manager/src/components/profiles/Conditionaln.jsx b/frontend/packages/manager/src/components/profiles/Conditionaln.jsx
index 38a2ce6..3b6a2b8 100644
--- a/frontend/packages/manager/src/components/profiles/Conditionaln.jsx
+++ b/frontend/packages/manager/src/components/profiles/Conditionaln.jsx
@@ -86,8 +86,8 @@ function ConditionalIn(props){
newIndices[`${keyID}`] in ValCtx.conditionalValuesErrors[props.conditionIndex]}/>
{((ValCtx.conditionalValuesErrors && props.conditionIndex in ValCtx.conditionalValuesErrors
&& newIndices[`${keyID}`] in ValCtx.conditionalValuesErrors[props.conditionIndex]) ?
- ValCtx.conditionalValuesErrors[props.conditionIndex][newIndices[`${keyID}`]].map((el) =>
- {el}
) : )}
+ ValCtx.conditionalValuesErrors[props.conditionIndex][newIndices[`${keyID}`]].map((el, i) =>
+ {el}
) : )}
);
diff --git a/frontend/packages/manager/src/components/profiles/FieldPatterns.jsx b/frontend/packages/manager/src/components/profiles/FieldPatterns.jsx
index cae23d8..015823d 100644
--- a/frontend/packages/manager/src/components/profiles/FieldPatterns.jsx
+++ b/frontend/packages/manager/src/components/profiles/FieldPatterns.jsx
@@ -78,13 +78,13 @@ function FieldPatterns(props){
const keyID = createDOMID();
newIndices[`${keyID}`] = indexCopy;
return (
-
+
- handleItemValue(newIndices[`${keyID}`], e)}
+ handleItemValue(newIndices[`${keyID}`], e)}
error={((ValCtx.conditionPatternsErrors && newIndices[`${keyID}`] in ValCtx.conditionPatternsErrors))}/>
{((ValCtx.conditionPatternsErrors && newIndices[`${keyID}`] in ValCtx.conditionPatternsErrors) ?
- ValCtx.conditionPatternsErrors[newIndices[`${keyID}`]].map((el) =>
- {el}
) : )}
+ ValCtx.conditionPatternsErrors[newIndices[`${keyID}`]].map((el, i) =>
+ {el}
) : )}
);
@@ -104,7 +104,7 @@ function FieldPatterns(props){
onRequestAdd={handleRequestAdd}
style={{ width: 300 }}
addLabel="Add pattern"
- data-test="form:field-patterns"
+ data-test="sc4snmp:form:field-patterns"
>
{rowItems}
diff --git a/frontend/packages/manager/src/components/profiles/ProfilesList.jsx b/frontend/packages/manager/src/components/profiles/ProfilesList.jsx
index b847e7b..c1c296f 100644
--- a/frontend/packages/manager/src/components/profiles/ProfilesList.jsx
+++ b/frontend/packages/manager/src/components/profiles/ProfilesList.jsx
@@ -176,8 +176,9 @@ function ProfilesList() {
{profilesRecords
- .map((row) => (
+ .map((row, i) => (
handleRowExpansion(row._id)}
@@ -191,8 +192,8 @@ function ProfilesList() {
{/* MIB category is empty in this view */}
{/* MIB index is empty in this view */}
-
))}
diff --git a/frontend/packages/manager/src/components/profiles/VarBinds.jsx b/frontend/packages/manager/src/components/profiles/VarBinds.jsx
index 8b1716f..ca98d92 100644
--- a/frontend/packages/manager/src/components/profiles/VarBinds.jsx
+++ b/frontend/packages/manager/src/components/profiles/VarBinds.jsx
@@ -90,21 +90,21 @@ function VarBinds(props){
const keyID = createDOMID();
newIndices[`${keyID}`] = indexCopy;
return (
-
+
- handleItemValueFamily(newIndices[`${keyID}`], e)}
error={((ValCtx.varBindsErrors && newIndices[`${keyID}`] in ValCtx.varBindsErrors))}/>
- handleItemValueCategory(newIndices[`${keyID}`], e)}
error={((ValCtx.varBindsErrors && newIndices[`${keyID}`] in ValCtx.varBindsErrors))}/>
- handleItemValueIndex(newIndices[`${keyID}`], e)}
error={((ValCtx.varBindsErrors && newIndices[`${keyID}`] in ValCtx.varBindsErrors))}/>
{((ValCtx.varBindsErrors && newIndices[`${keyID}`] in ValCtx.varBindsErrors) ?
- ValCtx.varBindsErrors[newIndices[`${keyID}`]].map((el) =>
{el}
) :
)}
@@ -126,7 +126,7 @@ function VarBinds(props){
onRequestAdd={handleRequestAdd}
style={{ width: 300 }}
addLabel="Add varBind"
- data-test="form:add-varbinds"
+ data-test="sc4snmp:form:add-varbinds"
>
{rowItems}
diff --git a/frontend/packages/manager/src/store/buttons-contx.jsx b/frontend/packages/manager/src/store/buttons-contx.jsx
index 94c8496..568a4e0 100644
--- a/frontend/packages/manager/src/store/buttons-contx.jsx
+++ b/frontend/packages/manager/src/store/buttons-contx.jsx
@@ -3,14 +3,11 @@ import React, {useState, createContext, useContext} from 'react';
const ButtonsContext = createContext();
export function ButtonsContextProvider(props){
- const [buttonsOpen, setButtonsOpen] = useState(false);
const [deleteOpen, setDeleteOpen] = useState(false);
const context = {
- buttonsOpen: buttonsOpen,
- setButtonsOpen: setButtonsOpen,
- deleteOpen: deleteOpen,
- setDeleteOpen: setDeleteOpen
+ deleteOpen,
+ setDeleteOpen
};
return (
diff --git a/frontend/packages/manager/src/store/group-contxt.jsx b/frontend/packages/manager/src/store/group-contxt.jsx
index b4d7581..49fbc46 100644
--- a/frontend/packages/manager/src/store/group-contxt.jsx
+++ b/frontend/packages/manager/src/store/group-contxt.jsx
@@ -66,8 +66,6 @@ export function GroupContextProvider(props){
setAddDeviceOpen,
deleteOpen: BtnCtx.deleteOpen,
setDeleteOpen: BtnCtx.setDeleteOpen,
- buttonsOpen: BtnCtx.buttonsOpen,
- setButtonsOpen: BtnCtx.setButtonsOpen,
deleteUrl,
setDeleteUrl,
deleteName,
diff --git a/frontend/packages/manager/src/store/inventory-contxt.jsx b/frontend/packages/manager/src/store/inventory-contxt.jsx
index ea76151..b491c16 100644
--- a/frontend/packages/manager/src/store/inventory-contxt.jsx
+++ b/frontend/packages/manager/src/store/inventory-contxt.jsx
@@ -54,9 +54,6 @@ export function InventoryContextProvider(props){
deleteOpen: BtnCtx.deleteOpen,
setDeleteOpen: BtnCtx.setDeleteOpen,
- buttonsOpen: BtnCtx.buttonsOpen,
- setButtonsOpen: BtnCtx.setButtonsOpen,
-
addOpen: addOpen,
setAddOpen: setAddOpen,
addModalToggle: addModalToggle,
diff --git a/frontend/packages/manager/src/tests/AddDeviceModal.test.jsx b/frontend/packages/manager/src/tests/AddDeviceModal.test.jsx
index bd4c69d..a23a5fc 100644
--- a/frontend/packages/manager/src/tests/AddDeviceModal.test.jsx
+++ b/frontend/packages/manager/src/tests/AddDeviceModal.test.jsx
@@ -23,9 +23,9 @@ describe("AddDeviceModal", () => {
it("Test invalid IPv4 address and no community string",() => {
renderModal();
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const addressInput = screen.getByDataTest('form:ip-input').querySelector("input");
- const communityInput = screen.getByDataTest('form:community-input').querySelector("input");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const addressInput = screen.getByDataTest('sc4snmp:form:ip-input').querySelector("input");
+ const communityInput = screen.getByDataTest('sc4snmp:form:community-input').querySelector("input");
fireEvent.change(addressInput, {target: {value: "1.2.3.4"}})
@@ -46,8 +46,8 @@ describe("AddDeviceModal", () => {
it("Test no IPv4 and walk interval below 1800", () => {
renderModal();
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const addressInput = screen.getByDataTest('form:ip-input').querySelector("input");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const addressInput = screen.getByDataTest('sc4snmp:form:ip-input').querySelector("input");
fireEvent.change(addressInput, {target: {value: ""}})
fireEvent.click(submitButton);
@@ -56,8 +56,8 @@ describe("AddDeviceModal", () => {
it("Test wrong port", () => {
renderModal();
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const portInput = screen.getByDataTest("form:port-input").querySelector("input");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const portInput = screen.getByDataTest("sc4snmp:form:port-input").querySelector("input");
fireEvent.change(portInput, {target: {value: ""}})
fireEvent.click(submitButton);
@@ -74,8 +74,8 @@ describe("AddDeviceModal", () => {
it("Test wrong security engine", () => {
renderModal();
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const securityEngineInput = screen.getByDataTest("form:security-engine-input").querySelector("input")
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const securityEngineInput = screen.getByDataTest("sc4snmp:form:security-engine-input").querySelector("input")
fireEvent.change(securityEngineInput, {target: {value: "a"}})
fireEvent.click(submitButton);
diff --git a/frontend/packages/manager/src/tests/AddGroupModal.test.jsx b/frontend/packages/manager/src/tests/AddGroupModal.test.jsx
index 41cfc32..374051a 100644
--- a/frontend/packages/manager/src/tests/AddGroupModal.test.jsx
+++ b/frontend/packages/manager/src/tests/AddGroupModal.test.jsx
@@ -23,8 +23,8 @@ function renderModal(){
describe("AddGroupModal", () => {
it("Test wrong group name", () => {
renderModal();
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const groupNameInput = screen.getByDataTest('form:group-name-input').querySelector("input");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const groupNameInput = screen.getByDataTest('sc4snmp:form:group-name-input').querySelector("input");
fireEvent.change(groupNameInput, {target: {value: "gro?up1"}})
fireEvent.click(submitButton);
@@ -34,8 +34,8 @@ describe("AddGroupModal", () => {
it("Test no group name provided", () => {
renderModal();
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const groupNameInput = screen.getByDataTest('form:group-name-input').querySelector("input");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const groupNameInput = screen.getByDataTest('sc4snmp:form:group-name-input').querySelector("input");
fireEvent.change(groupNameInput, {target: {value: ""}})
fireEvent.click(submitButton);
diff --git a/frontend/packages/manager/src/tests/AddInventoryModal.test.jsx b/frontend/packages/manager/src/tests/AddInventoryModal.test.jsx
index 2630f63..bc09e4b 100644
--- a/frontend/packages/manager/src/tests/AddInventoryModal.test.jsx
+++ b/frontend/packages/manager/src/tests/AddInventoryModal.test.jsx
@@ -33,9 +33,9 @@ describe("AddInventoryModal", () => {
axios.get.mockResolvedValueOnce({data:[]});
await act( async () => renderModal());
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const addressInput = screen.getByDataTest('form:group-ip-input').querySelector("input");
- const communityInput = screen.getByDataTest('form:community-input').querySelector("input");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const addressInput = screen.getByDataTest('sc4snmp:form:group-ip-input').querySelector("input");
+ const communityInput = screen.getByDataTest('sc4snmp:form:community-input').querySelector("input");
fireEvent.change(addressInput, {target: {value: "1.2.3.4"}})
@@ -56,9 +56,9 @@ describe("AddInventoryModal", () => {
it("Test no IPv4 and walk interval below 1800", async () => {
axios.get.mockResolvedValueOnce({data:[]});
await act( async () => renderModal());
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const addressInput = screen.getByDataTest('form:group-ip-input').querySelector("input");
- const walkIntervalInput = screen.getByDataTest('form:walk-interval-input').querySelector("input");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const addressInput = screen.getByDataTest('sc4snmp:form:group-ip-input').querySelector("input");
+ const walkIntervalInput = screen.getByDataTest('sc4snmp:form:walk-interval-input').querySelector("input");
fireEvent.change(addressInput, {target: {value: "group1"}})
fireEvent.change(walkIntervalInput, {target: {value: 10}});
@@ -76,9 +76,9 @@ describe("AddInventoryModal", () => {
it("Test wrong group name, no port and wrong port", async () => {
axios.get.mockResolvedValueOnce({data:[]});
await act( async () => renderModal());
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const addressInput = screen.getByDataTest('form:group-ip-input').querySelector("input");
- const portInput = screen.getByDataTest("form:port-input").querySelector("input");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const addressInput = screen.getByDataTest('sc4snmp:form:group-ip-input').querySelector("input");
+ const portInput = screen.getByDataTest("sc4snmp:form:port-input").querySelector("input");
fireEvent.change(addressInput, {target: {value: "group 1"}})
fireEvent.change(portInput, {target: {value: ""}})
@@ -99,8 +99,8 @@ describe("AddInventoryModal", () => {
it("Test wrong security engine", async () => {
axios.get.mockResolvedValueOnce({data:[]});
await act( async () => renderModal());
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const securityEngineInput = screen.getByDataTest("form:security-engine-input").querySelector("input")
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const securityEngineInput = screen.getByDataTest("sc4snmp:form:security-engine-input").querySelector("input")
fireEvent.change(securityEngineInput, {target: {value: "a"}})
fireEvent.click(submitButton);
@@ -116,12 +116,12 @@ describe("AddInventoryModal", () => {
it("Test no secret in version 3 of snmp", async () => {
axios.get.mockResolvedValueOnce({data:[]});
await act( async () => renderModal());
- const submitButton = screen.getByDataTest("form:submit-form-button");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
- const versionButton = screen.getByDataTest("form:version")
+ const versionButton = screen.getByDataTest("sc4snmp:form:select-version")
fireEvent.click(versionButton)
await sleep(5)
- const versionOptionButton = screen.getByDataTest("form:version-3")
+ const versionOptionButton = screen.getByDataTest("sc4snmp:form:version-3")
fireEvent.click(versionOptionButton)
await sleep(5)
diff --git a/frontend/packages/manager/src/tests/AddProfileModal.test.jsx b/frontend/packages/manager/src/tests/AddProfileModal.test.jsx
index c6907d3..7356e6a 100644
--- a/frontend/packages/manager/src/tests/AddProfileModal.test.jsx
+++ b/frontend/packages/manager/src/tests/AddProfileModal.test.jsx
@@ -25,7 +25,7 @@ const sleep = ms => new Promise(r => setTimeout(r, ms));
describe("AddProfileModal", () => {
it("Test no VarBinds and no profile name", () => {
renderModal();
- const submitButton = screen.getByDataTest("form:submit-form-button");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
expect(screen.queryByText("Profile Name is required")).not.toBeInTheDocument();
expect(screen.queryByText("At least one varBind must be specified.")).not.toBeInTheDocument();
@@ -36,9 +36,9 @@ describe("AddProfileModal", () => {
it("Test empty VarBind", async () => {
renderModal();
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const frequencyInput = screen.getByDataTest("form:frequency-input").querySelector("input")
- const addVarBindButton = screen.getByDataTest("form:add-varbinds").querySelector(`[data-test="add-row"]`)
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const frequencyInput = screen.getByDataTest("sc4snmp:form:frequency-input").querySelector("input")
+ const addVarBindButton = screen.getByDataTest("sc4snmp:form:add-varbinds").querySelector(`[data-test="add-row"]`)
fireEvent.click(addVarBindButton);
@@ -51,9 +51,9 @@ describe("AddProfileModal", () => {
it("Test adding multiple varbinds with errors", async () => {
renderModal();
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const frequencyInput = screen.getByDataTest("form:frequency-input").querySelector("input")
- const addVarBindButton = screen.getByDataTest("form:add-varbinds").querySelector(`[data-test="add-row"]`)
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const frequencyInput = screen.getByDataTest("sc4snmp:form:frequency-input").querySelector("input")
+ const addVarBindButton = screen.getByDataTest("sc4snmp:form:add-varbinds").querySelector(`[data-test="add-row"]`)
fireEvent.click(addVarBindButton);
@@ -61,11 +61,11 @@ describe("AddProfileModal", () => {
fireEvent.click(addVarBindButton);
fireEvent.change(frequencyInput, {target: {value: 2}})
let mibFamilyInput0 =
- screen.getByDataTest("form:varbind0-mib-family-input").querySelector("input")
+ screen.getByDataTest("sc4snmp:form:varbind0-mib-family-input").querySelector("input")
const mibCategoryInput1 =
- screen.getByDataTest("form:varbind1-mib-category-input").querySelector("input")
+ screen.getByDataTest("sc4snmp:form:varbind1-mib-category-input").querySelector("input")
const mibIndexInput2 =
- screen.getByDataTest("form:varbind2-mib-index-input").querySelector("input")
+ screen.getByDataTest("sc4snmp:form:varbind2-mib-index-input").querySelector("input")
fireEvent.change(mibFamilyInput0, {target: {value: "mi b"}})
fireEvent.change(mibCategoryInput1, {target: {value: "aa?"}})
@@ -73,9 +73,9 @@ describe("AddProfileModal", () => {
fireEvent.click(submitButton);
await sleep(5)
- let firstRow = screen.getByDataTest("form:varbind-row-0")
- const secondRow = screen.getByDataTest("form:varbind-row-1")
- const thirdRow = screen.getByDataTest("form:varbind-row-2")
+ let firstRow = screen.getByDataTest("sc4snmp:form:varbind-row-0")
+ const secondRow = screen.getByDataTest("sc4snmp:form:varbind-row-1")
+ const thirdRow = screen.getByDataTest("sc4snmp:form:varbind-row-2")
expect(within(firstRow).queryByText("MIB-Component can consist only of upper and lower english letters, " +
"numbers and two special characters: '-' and '_'. No spaces are allowed.")).toBeInTheDocument()
@@ -90,37 +90,37 @@ describe("AddProfileModal", () => {
// Delete first two rows
await sleep(10)
- let deleteRowButton0 = screen.getByDataTest("form:varbind-row-0").querySelector(`[data-test="remove"]`)
+ let deleteRowButton0 = screen.getByDataTest("sc4snmp:form:varbind-row-0").querySelector(`[data-test="remove"]`)
fireEvent.click(deleteRowButton0)
await sleep(10)
- deleteRowButton0 = screen.getByDataTest("form:varbind-row-0").querySelector(`[data-test="remove"]`)
+ deleteRowButton0 = screen.getByDataTest("sc4snmp:form:varbind-row-0").querySelector(`[data-test="remove"]`)
fireEvent.click(deleteRowButton0)
await sleep(10)
- firstRow = screen.getByDataTest("form:varbind-row-0")
+ firstRow = screen.getByDataTest("sc4snmp:form:varbind-row-0")
expect(within(firstRow).queryByText("MIB-Component is required")).toBeInTheDocument()
expect(within(firstRow).queryByText("MIB object is required when MIB index is specified")).toBeInTheDocument()
expect(within(firstRow).queryByText("Index can't include white spaces")).toBeInTheDocument()
// Delete remaining row and add the new one
await sleep(10)
- deleteRowButton0 = screen.getByDataTest("form:varbind-row-0").querySelector(`[data-test="remove"]`)
+ deleteRowButton0 = screen.getByDataTest("sc4snmp:form:varbind-row-0").querySelector(`[data-test="remove"]`)
fireEvent.click(deleteRowButton0)
await sleep(10)
fireEvent.click(addVarBindButton);
await sleep(10);
mibFamilyInput0 =
- screen.getByDataTest("form:varbind0-mib-family-input").querySelector("input")
+ screen.getByDataTest("sc4snmp:form:varbind0-mib-family-input").querySelector("input")
fireEvent.change(mibFamilyInput0, {target: {value: "mib"}})
- firstRow = screen.getByDataTest("form:varbind-row-0")
+ firstRow = screen.getByDataTest("sc4snmp:form:varbind-row-0")
expect(within(firstRow).queryByText("MIB-Component is required")).not.toBeInTheDocument()
})
it ("Test empty field and no patterns in smart profile", () => {
renderModal({profileType: "smart"})
- const submitButton = screen.getByDataTest("form:submit-form-button");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
expect(screen.queryByText("Field is required")).not.toBeInTheDocument();
expect(screen.queryByText("At least one pattern must be specified.")).not.toBeInTheDocument();
@@ -131,21 +131,21 @@ describe("AddProfileModal", () => {
it("Test wrong field and empty pattern in smart profile", async () => {
renderModal({profileType: "smart"})
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const addPatternButton = screen.getByDataTest("form:field-patterns").querySelector(`[data-test="add-row"]`)
- const fieldInput = screen.getByDataTest("form:condition-field-input").querySelector("input")
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const addPatternButton = screen.getByDataTest("sc4snmp:form:field-patterns").querySelector(`[data-test="add-row"]`)
+ const fieldInput = screen.getByDataTest("sc4snmp:form:condition-field-input").querySelector("input")
fireEvent.click(addPatternButton);
fireEvent.click(addPatternButton);
fireEvent.change(fieldInput, {target: {value: "t est"}});
- let patternInput0 = screen.getByDataTest("form:field-pattern-0").querySelector("input")
+ let patternInput0 = screen.getByDataTest("sc4snmp:form:field-pattern-0").querySelector("input")
fireEvent.change(patternInput0, {target: {value: "test"}})
fireEvent.click(submitButton);
await sleep(10)
- let firstRow = screen.getByDataTest("form:field-pattern-row-0")
- const secondRow = screen.getByDataTest("form:field-pattern-row-1")
+ let firstRow = screen.getByDataTest("sc4snmp:form:field-pattern-row-0")
+ const secondRow = screen.getByDataTest("sc4snmp:form:field-pattern-row-1")
expect(screen.queryByText("Field can consist only of upper and lower english letters, " +
"numbers and three special characters: '.' '-' and '_'. No spaces are allowed.")).toBeInTheDocument();
@@ -154,21 +154,21 @@ describe("AddProfileModal", () => {
// Delete first row
await sleep(10)
- let deleteRowButton0 = screen.getByDataTest("form:field-pattern-row-0").querySelector(`[data-test="remove"]`)
+ let deleteRowButton0 = screen.getByDataTest("sc4snmp:form:field-pattern-row-0").querySelector(`[data-test="remove"]`)
fireEvent.click(deleteRowButton0)
await sleep(10)
- firstRow = screen.getByDataTest("form:field-pattern-row-0")
+ firstRow = screen.getByDataTest("sc4snmp:form:field-pattern-row-0")
expect(within(firstRow).queryByText("Pattern is required")).toBeInTheDocument();
// Delete remaining row and add the new one
await sleep(10)
- deleteRowButton0 = screen.getByDataTest("form:field-pattern-row-0").querySelector(`[data-test="remove"]`)
+ deleteRowButton0 = screen.getByDataTest("sc4snmp:form:field-pattern-row-0").querySelector(`[data-test="remove"]`)
fireEvent.click(deleteRowButton0)
await sleep(10)
fireEvent.click(addPatternButton);
await sleep(10)
- patternInput0 = screen.getByDataTest("form:field-pattern-0").querySelector("input")
+ patternInput0 = screen.getByDataTest("sc4snmp:form:field-pattern-0").querySelector("input")
fireEvent.change(patternInput0, {target: {value: "test"}})
fireEvent.click(submitButton);
await sleep(10)
@@ -177,7 +177,7 @@ describe("AddProfileModal", () => {
it("Test no conditions", () => {
renderModal({profileType: "conditional"})
- const submitButton = screen.getByDataTest("form:submit-form-button");
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
expect(screen.queryByText("At least one condition must be specified.")).not.toBeInTheDocument();
fireEvent.click(submitButton);
@@ -186,8 +186,8 @@ describe("AddProfileModal", () => {
it("Test errors in multiple conditions", async () => {
renderModal({profileType: "conditional"})
- const submitButton = screen.getByDataTest("form:submit-form-button");
- const addConditionalButton = screen.getByDataTest("form:conditional-profile").querySelector(`[data-test="add-row"]`)
+ const submitButton = screen.getByDataTest("sc4snmp:form:submit-form-button");
+ const addConditionalButton = screen.getByDataTest("sc4snmp:form:add-conditional-profile").querySelector(`[data-test="add-row"]`)
fireEvent.click(addConditionalButton);
fireEvent.click(addConditionalButton);
@@ -195,19 +195,19 @@ describe("AddProfileModal", () => {
await sleep(5);
- const optionsButton1 = screen.getByDataTest("form:conditional-select-operation-1")
+ const optionsButton1 = screen.getByDataTest("sc4snmp:form:conditional-select-operation-1")
fireEvent.click(optionsButton1)
await sleep(5)
- const inOptionButton1 = screen.getByDataTest("form:conditional-in-1")
+ const inOptionButton1 = screen.getByDataTest("sc4snmp:form:conditional-in-1")
fireEvent.click(inOptionButton1)
await sleep(5)
const fieldInput0 =
- screen.getByDataTest("form:conditional-field-0").querySelector('[data-test="textbox"]')
+ screen.getByDataTest("sc4snmp:form:conditional-field-0").querySelector('[data-test="textbox"]')
const fieldInput2 =
- screen.getByDataTest("form:conditional-field-2").querySelector('[data-test="textbox"]')
+ screen.getByDataTest("sc4snmp:form:conditional-field-2").querySelector('[data-test="textbox"]')
const valueInput2 =
- screen.getByDataTest("form:conditional-condition-2").querySelector('[data-test="textbox"]')
+ screen.getByDataTest("sc4snmp:form:conditional-condition-2").querySelector('[data-test="textbox"]')
fireEvent.change(fieldInput0, {target: {value: "te st"}})
fireEvent.change(fieldInput2, {target: {value: "test"}})
@@ -218,9 +218,9 @@ describe("AddProfileModal", () => {
fireEvent.click(submitButton);
fireEvent.click(submitButton);
- let firstRow = screen.getByDataTest("form:conditional-row-0")
- const secondRow = screen.getByDataTest("form:conditional-row-1")
- const thirdRow = screen.getByDataTest("form:conditional-row-2")
+ let firstRow = screen.getByDataTest("sc4snmp:form:conditional-row-0")
+ const secondRow = screen.getByDataTest("sc4snmp:form:conditional-row-1")
+ const thirdRow = screen.getByDataTest("sc4snmp:form:conditional-row-2")
expect(within(firstRow).queryByText("Field can consist only of upper and lower english letters, " +
"numbers and three special characters: '.' '-' and '_'. No spaces are allowed.")).toBeInTheDocument();
@@ -236,17 +236,17 @@ describe("AddProfileModal", () => {
// Delete first and second row
await sleep(10)
- let deleteRowButton0 = screen.getByDataTest("form:conditional-row-0").querySelector(`[data-test="remove"]`)
+ let deleteRowButton0 = screen.getByDataTest("sc4snmp:form:conditional-row-0").querySelector(`[data-test="remove"]`)
fireEvent.click(deleteRowButton0)
await sleep(10)
- deleteRowButton0 = screen.getByDataTest("form:conditional-row-0").querySelector(`[data-test="remove"]`)
+ deleteRowButton0 = screen.getByDataTest("sc4snmp:form:conditional-row-0").querySelector(`[data-test="remove"]`)
fireEvent.click(deleteRowButton0)
await sleep(10)
- deleteRowButton0 = screen.getByDataTest("form:conditional-row-0").querySelector(`[data-test="remove"]`)
+ deleteRowButton0 = screen.getByDataTest("sc4snmp:form:conditional-row-0").querySelector(`[data-test="remove"]`)
fireEvent.click(deleteRowButton0)
await sleep(10)
- firstRow = screen.getByDataTest("form:conditional-row-0")
+ firstRow = screen.getByDataTest("sc4snmp:form:conditional-row-0")
expect(within(firstRow).queryByText("Field can consist only of upper and lower english letters, " +
"numbers and three special characters: '.' '-' and '_'. No spaces are allowed.")).not.toBeInTheDocument();
expect(within(firstRow).queryByText("Field is required")).not.toBeInTheDocument()
@@ -254,20 +254,20 @@ describe("AddProfileModal", () => {
// Delete remaining row and add the new one
await sleep(10)
- deleteRowButton0 = screen.getByDataTest("form:conditional-row-0").querySelector(`[data-test="remove"]`)
+ deleteRowButton0 = screen.getByDataTest("sc4snmp:form:conditional-row-0").querySelector(`[data-test="remove"]`)
fireEvent.click(deleteRowButton0)
await sleep(10)
fireEvent.click(addConditionalButton);
await sleep(10);
const valueInput0 =
- screen.getByDataTest("form:conditional-condition-0").querySelector('[data-test="textbox"]')
+ screen.getByDataTest("sc4snmp:form:conditional-condition-0").querySelector('[data-test="textbox"]')
fireEvent.change(valueInput0, {target: {value: "2"}})
fireEvent.click(submitButton)
await sleep(5)
- firstRow = screen.getByDataTest("form:conditional-row-0")
+ firstRow = screen.getByDataTest("sc4snmp:form:conditional-row-0")
expect(within(firstRow).queryByText("Field is required")).toBeInTheDocument()
expect(within(firstRow).queryByText("Value is required")).not.toBeInTheDocument()
diff --git a/frontend/packages/manager/src/tests/mock_context_providers/MockGroupContextProvider.jsx b/frontend/packages/manager/src/tests/mock_context_providers/MockGroupContextProvider.jsx
index 221cc87..68cfb25 100644
--- a/frontend/packages/manager/src/tests/mock_context_providers/MockGroupContextProvider.jsx
+++ b/frontend/packages/manager/src/tests/mock_context_providers/MockGroupContextProvider.jsx
@@ -56,8 +56,6 @@ export function MockGroupContextProvider(props){
setAddDeviceOpen: setStateMock,
deleteOpen: true,
setDeleteOpen: setStateMock,
- buttonsOpen: false,
- setButtonsOpen: setStateMock,
deleteUrl: "",
setDeleteUrl: setStateMock,
deleteName: "",
diff --git a/frontend/packages/manager/src/tests/mock_context_providers/MockInventoryContextProvider.jsx b/frontend/packages/manager/src/tests/mock_context_providers/MockInventoryContextProvider.jsx
index c855dc7..71d8cc7 100644
--- a/frontend/packages/manager/src/tests/mock_context_providers/MockInventoryContextProvider.jsx
+++ b/frontend/packages/manager/src/tests/mock_context_providers/MockInventoryContextProvider.jsx
@@ -47,9 +47,6 @@ export function MockInventoryContextProvider(props){
deleteOpen: false,
setDeleteOpen: setStateMock,
- buttonsOpen: false,
- setButtonsOpen: setStateMock,
-
addOpen: true,
setAddOpen: setStateMock,
addModalToggle: null,