diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.test.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.test.js index 5a6dcc003a6c095aac7af4f5f4511ad4bd180bd8..67139aab1138f86b1be6cdb453fdd4c0d87c502c 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.test.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.test.js @@ -1,7 +1,7 @@ import React from 'react'; import { BrowserRouter as Router } from 'react-router-dom'; import { act } from "react-dom/test-utils"; -import { render, cleanup, fireEvent,waitFor } from '@testing-library/react'; +import { render, cleanup, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; import mockConsole from 'jest-mock-console'; import _ from 'lodash'; @@ -1519,15 +1519,13 @@ it("Checking Correctness of Custom fields in JEditor using Simple Observation dr expect(freqSAP.value).toBe('99.9-147.6'); - /* These seems to be actually not present in the node. Unclear if this is due too a failing test, or recently changed design */ - + await waitFor(()=>expect(content.getByRole("textbox",{name: "specification[station_configuration][SAPs][0][digital_pointing][angle1]"})).toBeInTheDocument()); await waitFor(()=>expect(content.getByRole("textbox",{name: "specification[station_configuration][SAPs][0][digital_pointing][angle2]"})).toBeInTheDocument()); const angle1El =content.getByRole("textbox",{name: "specification[station_configuration][SAPs][0][digital_pointing][angle1]"}); - const angle1E2 =content.getByRole("textbox",{name: "specification[station_configuration][SAPs][0][digital_pointing][angle1]"}); + const angle1E2 =content.getByRole("textbox",{name: "specification[station_configuration][SAPs][0][digital_pointing][angle2]"}); expect(angle1El.value).toBe('03h06m00s'); - //const angle1E2 = content.getByLabelText("specification[station_configuration][SAPs][0][digital_pointing][angle2]"); expect(angle1E2.value).toBe('89d59m00s'); }); \ No newline at end of file diff --git a/SAS/TMSS/frontend/tmss_webapp/src/utils/test.helper.js b/SAS/TMSS/frontend/tmss_webapp/src/utils/test.helper.js index 289339801b5290364df911cc9ba136b94cca2e0b..7e47597f9a485aa44417235061b1b5bb50e94039 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/utils/test.helper.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/utils/test.helper.js @@ -1,5 +1,5 @@ import {act} from "react-dom/test-utils"; -import {fireEvent, render, screen} from "@testing-library/react"; +import {fireEvent, render, screen,waitFor} from "@testing-library/react"; import {BrowserRouter as Router} from "react-router-dom"; const TIMEOUT = 300 @@ -12,6 +12,7 @@ export async function clickItem(item, timeout = TIMEOUT) { } export async function setMultiSelectValue(pageContent, multiSelectTestId, multiSelectValue, timeout = TIMEOUT) { + await waitFor(() => expect(pageContent.queryByTestId(multiSelectTestId)).toBeInTheDocument()); // give rendering the time to have it. await clickItem(pageContent.queryByTestId(multiSelectTestId)); let items = []