diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f982954c..d3f5e31f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, # they will be requested for review when someone opens a pull request. -* @dinesh-aot @salabh-aot @jadmsaadaot @saravanpa-aot \ No newline at end of file +* @dinesh-aot @jadmsaadaot @saravanpa-aot \ No newline at end of file diff --git a/compliance-web/cypress.config.cjs b/compliance-web/cypress.config.cjs new file mode 100644 index 00000000..f27cf728 --- /dev/null +++ b/compliance-web/cypress.config.cjs @@ -0,0 +1,21 @@ +/* eslint-disable no-undef */ + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { defineConfig } = require('cypress'); + +module.exports = defineConfig({ + component: { + devServer: { + framework: "react", + bundler: "vite", + }, + setupNodeEvents(on, config) { + require('@cypress/code-coverage/task')(on, config) + // include any other plugin code... + + // It's IMPORTANT to return the config object + // with any changed environment variables + return config + }, + }, +}); \ No newline at end of file diff --git a/compliance-web/src/App.cy.tsx b/compliance-web/src/App.cy.tsx new file mode 100644 index 00000000..b8428adc --- /dev/null +++ b/compliance-web/src/App.cy.tsx @@ -0,0 +1,46 @@ +import { mount } from "cypress/react18"; // or `cypress/react18` if using React 18 +import { ThemeProvider } from "@mui/material"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; +import { AuthProvider } from "react-oidc-context"; +import { OidcConfig } from "@/utils/config"; +import { theme } from "@/styles/theme"; +import { createRouter, RouterProvider } from "@tanstack/react-router"; +import { routeTree } from "@/routeTree.gen"; + +const queryClient = new QueryClient(); + +const router = createRouter({ + routeTree, + context: { + authentication: undefined!, + }, +}); + +function TestApp({ authentication }) { + return ( + + + + + + + + + ); +} + +describe("", () => { + it("renders", () => { + const mockAuth = { + // mock the necessary properties and methods for useAuth context + isAuthenticated: true, + user: { profile: { name: "Test User" } }, + signoutRedirect: cy.stub(), + signinRedirect: cy.stub(), + // add other necessary mocks here + }; + mount(); + cy.contains("Users"); + }); +}); \ No newline at end of file