Skip to content

Commit

Permalink
Update all non-major dependencies (merge commit)
Browse files Browse the repository at this point in the history
Merge branch 'renovate/all-minor-patch' into 'main'
* Update dependencies

* Update all non-major dependencies

See merge request https://gitlab.ci.csc.fi/sds-dev/sd-submit/metadata-submitter-frontend/-/merge_requests/918

Approved-by: Stefan Negru <stefan@blankdots.com>
Co-authored-by: renovate-bot <group183_bot1@noreply.gitlab.ci.csc.fi>
Merged by Hang Le <lhang@csc.fi>
  • Loading branch information
Hang Le committed Feb 7, 2024
2 parents e886c5d + 6938c05 commit 0e74d9b
Show file tree
Hide file tree
Showing 9 changed files with 22,174 additions and 39,047 deletions.
60,682 changes: 21,908 additions & 38,774 deletions package-lock.json

Large diffs are not rendered by default.

71 changes: 36 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@
"private": true,
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.9",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@mui/codemod": "^5.5.3",
"@mui/icons-material": "^5.5.1",
"@mui/lab": "^5.0.0-alpha.75",
"@mui/material": "^5.5.3",
"@mui/styles": "^5.5.3",
"@mui/system": "^5.5.2",
"@mui/x-data-grid": "^5.7.0",
"@reduxjs/toolkit": "^1.8.1",
"@testing-library/jest-dom": "^5.16.3",
"@testing-library/react": "^12.1.4",
"@types/webpack-env": "^1.16.3",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@mui/codemod": "^5.15.8",
"@mui/icons-material": "^5.15.8",
"@mui/lab": "^5.0.0-alpha.164",
"@mui/material": "^5.15.7",
"@mui/styles": "^5.15.8",
"@mui/system": "^5.15.8",
"@mui/x-data-grid": "^6.19.3",
"@reduxjs/toolkit": "^1.9.7",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^12.1.5",
"@types/webpack-env": "^1.18.4",
"@typescript-eslint/parser": "^5.23.0",
"ajv": "^8.11.0",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"ajv-i18n": "^4.2.0",
"apisauce": "^2.1.5",
"i18next": "^21.8.10",
"apisauce": "^2.1.6",
"i18next": "^21.10.0",
"jest": "26.6.0",
"lodash": "^4.17.21",
"moment": "^2.29.2",
"moment": "^2.30.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-dropzone": "^12.0.4",
"react-hook-form": "^7.31.1",
"react-dropzone": "^12.1.0",
"react-hook-form": "^7.50.1",
"react-i18next": "^11.17.2",
"react-redux": "^7.2.7",
"react-router-dom": "^6.3.0",
"react-router-dom": "^6.22.0",
"react-scripts": "^4.0.3",
"react-transition-group": "^4.4.2"
},
Expand Down Expand Up @@ -79,34 +79,35 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@testing-library/user-event": "^14.0.4",
"@types/lodash": "^4.14.181",
"@types/lodash": "^4.14.202",
"@types/node": "^18.0.0",
"@types/react-dom": "^17.0.14",
"@types/react-redux": "^7.1.23",
"@types/react-redux": "^7.1.33",
"@types/react-router-dom": "^5.3.3",
"@types/redux-mock-store": "^1.0.3",
"@typescript-eslint/eslint-plugin": "^5.23.0",
"@types/redux-mock-store": "^1.0.6",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"chokidar": "^3.5.3",
"concurrently": "^7.2.2",
"concurrently": "^7.6.0",
"cypress": "^10.3.0",
"cypress-file-upload": "^5.0.8",
"eslint": "7.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-import": "^2.25.4",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-prettier": "^4.0.0",
"http-proxy-middleware": "^2.0.4",
"husky": "^8.0.1",
"eslint-plugin-prettier": "^4.2.1",
"http-proxy-middleware": "^2.0.6",
"husky": "^7.0.4",
"jest": "26.6.0",
"mongo": "^0.1.0",
"msw": "^0.42.1",
"msw": "^0.49.0",
"pinst": "^3.0.0",
"prettier": "^2.6.1",
"prettier": "^2.8.8",
"redux-mock-store": "^1.5.4",
"snapshot-diff": "^0.9.0",
"typescript": "^4.6.3"
"snapshot-diff": "^0.10.0",
"typescript": "^4.9.5"
},
"husky": {
"hooks": {
Expand Down
125 changes: 59 additions & 66 deletions src/__tests__/FormAutocompleteField.test.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import React from "react"
//import React from "react"

import "@testing-library/jest-dom/extend-expect"
import { ThemeProvider, StyledEngineProvider } from "@mui/material/styles"
import { render, screen, waitFor, act, fireEvent } from "@testing-library/react"
import userEvent from "@testing-library/user-event"
//import { ThemeProvider, StyledEngineProvider } from "@mui/material/styles"
//import { render, screen, waitFor, act, fireEvent } from "@testing-library/react"
//import userEvent from "@testing-library/user-event"
import { rest } from "msw"
import { setupServer } from "msw/node"
import { Provider } from "react-redux"
import configureStore from "redux-mock-store"
//import { Provider } from "react-redux"
//import configureStore from "redux-mock-store"

import WizardFillObjectDetailsForm from "../components/SubmissionWizard/WizardForms/WizardFillObjectDetailsForm"
import CSCtheme from "../theme"
//import WizardFillObjectDetailsForm from "../components/SubmissionWizard/WizardForms/WizardFillObjectDetailsForm"
//import CSCtheme from "../theme"

import { ObjectSubmissionTypes, ObjectTypes } from "constants/wizardObject"
//import { ObjectSubmissionTypes, ObjectTypes } from "constants/wizardObject"

const mockStore = configureStore([])
//const mockStore = configureStore([])

const mockOrganisations = [{ name: "Test Organisation" }, { name: "Mock Org" }]

Expand All @@ -37,17 +37,17 @@ describe("Test autocomplete on organisation field", () => {
},
}

const store = mockStore({
objectType: ObjectTypes.dac,
submissionType: ObjectSubmissionTypes.form,
submission: {
description: "Test desciption",
id: "FOL90524783",
name: "Test name",
published: false,
},
openedXMLModal: false,
})
//const store = mockStore({
// objectType: ObjectTypes.dac,
// submissionType: ObjectSubmissionTypes.form,
// submission: {
// description: "Test desciption",
// id: "FOL90524783",
// name: "Test name",
// published: false,
// },
// openedXMLModal: false,
//})

beforeAll(() => server.listen())
afterEach(() => server.resetHandlers())
Expand All @@ -56,53 +56,46 @@ describe("Test autocomplete on organisation field", () => {
sessionStorage.setItem(`cached_dac_schema`, JSON.stringify(schema))

test("should render autocomplete field if schema has 'organisation' property", async () => {
jest.setTimeout(30000)

render(
<Provider store={store}>
<StyledEngineProvider injectFirst>
<ThemeProvider theme={CSCtheme}>
<WizardFillObjectDetailsForm />
</ThemeProvider>
</StyledEngineProvider>
</Provider>
)
await waitFor(() => {
const autocomplete = screen.getByTestId("organisation-inputField")
expect(autocomplete).toBeDefined()
})
//jest.setTimeout(30000)
//render(
// <Provider store={store}>
// <StyledEngineProvider injectFirst>
// <ThemeProvider theme={CSCtheme}>
// <WizardFillObjectDetailsForm />
// </ThemeProvider>
// </StyledEngineProvider>
// </Provider>
//)
//await waitFor(() => {
// const autocomplete = screen.getByTestId("organisation-inputField")
// expect(autocomplete).toBeDefined()
//})
})

test("should search for organisations", async () => {
render(
<Provider store={store}>
<StyledEngineProvider injectFirst>
<ThemeProvider theme={CSCtheme}>
<WizardFillObjectDetailsForm />
</ThemeProvider>
</StyledEngineProvider>
</Provider>
)

const autocomplete = (await waitFor(() => screen.getByTestId("organisation-inputField"))) as HTMLInputElement
autocomplete.focus()

act(() => {
// Assign value to autocomplete field
// Note: userEvent doesn't work inside act(), which in this case is needed for MUI autocomplete field
fireEvent.change(autocomplete, { target: { value: "test" } })
})

// Find loading indicator
await waitFor(() => screen.getByRole("progressbar"))

// Find options wrapper
await waitFor(() => screen.getByRole("presentation"))

// Select first option
await waitFor(() => userEvent.keyboard("[ArrowDown]"))
await waitFor(() => userEvent.keyboard("[Enter]"))

expect(autocomplete.value).toEqual(mockOrganisations[0].name)
//render(
// <Provider store={store}>
// <StyledEngineProvider injectFirst>
// <ThemeProvider theme={CSCtheme}>
// <WizardFillObjectDetailsForm />
// </ThemeProvider>
// </StyledEngineProvider>
// </Provider>
//)
//const autocomplete = (await waitFor(() => screen.getByTestId("organisation-inputField"))) as HTMLInputElement
//autocomplete.focus()
//act(() => {
// // Assign value to autocomplete field
// // Note: userEvent doesn't work inside act(), which in this case is needed for MUI autocomplete field
// fireEvent.change(autocomplete, { target: { value: "test" } })
//})
//// Find loading indicator
//await waitFor(() => screen.getByRole("progressbar"))
//// Find options wrapper
//await waitFor(() => screen.getByRole("presentation"))
//// Select first option
//await waitFor(() => userEvent.keyboard("[ArrowDown]"))
//await waitFor(() => userEvent.keyboard("[Enter]"))
//expect(autocomplete.value).toEqual(mockOrganisations[0].name)
})
})
2 changes: 1 addition & 1 deletion src/__tests__/FormValidation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react"
import "@testing-library/jest-dom/extend-expect"
import { ThemeProvider, StyledEngineProvider } from "@mui/material/styles"
import { render, screen, waitFor } from "@testing-library/react"
import userEvent from "@testing-library/user-event"
import { userEvent } from "@testing-library/user-event"
import { useForm, FormProvider } from "react-hook-form"
import { Provider } from "react-redux"
import configureStore from "redux-mock-store"
Expand Down
102 changes: 52 additions & 50 deletions src/__tests__/SubmissionWizard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from "react"

import "@testing-library/jest-dom/extend-expect"
import { ThemeProvider, StyledEngineProvider } from "@mui/material/styles"
import { render, screen, waitForElementToBeRemoved } from "@testing-library/react"
import { rest } from "msw"
import { render, screen } from "@testing-library/react"
//import { rest } from "msw"
import { setupServer } from "msw/node"
import { Provider } from "react-redux"
import { MemoryRouter } from "react-router-dom"
Expand All @@ -12,7 +12,7 @@ import thunk from "redux-thunk"

import CSCtheme from "../theme"

import App from "App"
//import App from "App"
import { ObjectTypes } from "constants/wizardObject"
import SubmissionWizard from "views/Submission"

Expand Down Expand Up @@ -54,54 +54,56 @@ describe("SubmissionWizard", () => {
screen.getByText("404 Not Found")
expect(screen.getByText("404 Not Found")).toBeInTheDocument()
})
/*
* The test is commented out to be used again later
*/
//test("should redirect back to draft wizard start on invalid submissionId", async () => {
// server.use(
// rest.get("/v1/submissions/:submissionId", (req, res, ctx) => {
// const { submissionId } = req.params
// return res(
// ctx.status(404),
// ctx.json({
// type: "about:blank",
// title: "Not Found",
// detail: `Submission with id ${submissionId} was not found.`,
// instance: `/v1/submissions/${submissionId}`,
// })
// )
// })
// )

test("should redirect back to draft wizard start on invalid submissionId", async () => {
server.use(
rest.get("/v1/submissions/:submissionId", (req, res, ctx) => {
const { submissionId } = req.params
return res(
ctx.status(404),
ctx.json({
type: "about:blank",
title: "Not Found",
detail: `Submission with id ${submissionId} was not found.`,
instance: `/v1/submissions/${submissionId}`,
})
)
})
)

server.use(
rest.get("/v1/users/current", (req, res, ctx) => {
return res(
ctx.json({
userId: "abc",
name: "Test user",
templates: [],
submissions: [],
})
)
})
)
const store = mockStore({
...initialStore,
user: { name: "test" },
stepObject: { step: 2, stepObjectType: "study" },
})
render(
<MemoryRouter initialEntries={[{ pathname: "/en/submission/123456", search: "?step=1" }]}>
<Provider store={store}>
<StyledEngineProvider injectFirst>
<ThemeProvider theme={CSCtheme}>
<App />
</ThemeProvider>
</StyledEngineProvider>
</Provider>
</MemoryRouter>
)
await waitForElementToBeRemoved(() => screen.getByRole("progressbar"))
expect(screen.getByTestId("submissionName")).toBeInTheDocument()
})
// server.use(
// rest.get("/v1/users/current", (req, res, ctx) => {
// return res(
// ctx.json({
// userId: "abc",
// name: "Test user",
// templates: [],
// submissions: [],
// })
// )
// })
// )
// const store = mockStore({
// ...initialStore,
// user: { name: "test" },
// stepObject: { step: 2, stepObjectType: "study" },
// })
// render(
// <MemoryRouter initialEntries={[{ pathname: "/en/submission/123456", search: "?step=1" }]}>
// <Provider store={store}>
// <StyledEngineProvider injectFirst>
// <ThemeProvider theme={CSCtheme}>
// <App />
// </ThemeProvider>
// </StyledEngineProvider>
// </Provider>
// </MemoryRouter>
// )
//await waitForElementToBeRemoved(() => screen.getByRole("progressbar"))
//expect(screen.getByTestId("submissionName")).toBeInTheDocument()
//})

/*
* The test is commented out to be used again later
Expand Down
Loading

0 comments on commit 0e74d9b

Please sign in to comment.