@@ -2,6 +2,9 @@ import { mount } from "cypress/react";
22import CaseFileActions from "@/components/App/CaseFiles/Profile/CaseFileActions" ;
33import { QueryClient , QueryClientProvider } from "@tanstack/react-query" ;
44import ModalProvider from "@/components/Shared/Modals/ModalProvider" ;
5+ import { CaseFileStatusEnum } from "@/utils/constants" ;
6+ import { OidcConfig } from "@/utils/config" ;
7+ import { AuthProvider } from "react-oidc-context" ;
58
69describe ( "CaseFileActions" , ( ) => {
710 let queryClient : QueryClient ;
@@ -13,19 +16,21 @@ describe("CaseFileActions", () => {
1316 const mountComponent = ( status : string ) => {
1417 mount (
1518 < QueryClientProvider client = { queryClient } >
16- < ModalProvider />
17- < CaseFileActions status = { status } fileNumber = "CF-123" />
19+ < AuthProvider { ...OidcConfig } >
20+ < ModalProvider />
21+ < CaseFileActions status = { status } fileNumber = "CF-123" />
22+ </ AuthProvider >
1823 </ QueryClientProvider >
1924 ) ;
2025 } ;
2126
2227 it ( "renders menu action dropdown" , ( ) => {
23- mountComponent ( "open" ) ;
28+ mountComponent ( CaseFileStatusEnum . OPEN ) ;
2429 cy . contains ( "button" , "Actions" ) . should ( "exist" ) ;
2530 } ) ;
2631
2732 it ( "shows all actions for open case file" , ( ) => {
28- mountComponent ( "open" ) ;
33+ mountComponent ( CaseFileStatusEnum . OPEN ) ;
2934 cy . contains ( "button" , "Actions" ) . click ( ) ;
3035
3136 cy . contains ( "Link to Case File" ) . should ( "exist" ) ;
@@ -36,7 +41,7 @@ describe("CaseFileActions", () => {
3641 } ) ;
3742
3843 it ( "shows appropriate actions for closed case file" , ( ) => {
39- mountComponent ( "closed" ) ;
44+ mountComponent ( CaseFileStatusEnum . CLOSED ) ;
4045 cy . contains ( "button" , "Actions" ) . click ( ) ;
4146
4247 cy . contains ( "Link to Case File" ) . should ( "not.exist" ) ;
@@ -47,7 +52,7 @@ describe("CaseFileActions", () => {
4752 } ) ;
4853
4954 it ( "handles Link to Case File click" , ( ) => {
50- mountComponent ( "open" ) ;
55+ mountComponent ( CaseFileStatusEnum . OPEN ) ;
5156 cy . contains ( "button" , "Actions" ) . click ( ) ;
5257 cy . contains ( "Link to Case File" ) . click ( ) ;
5358
@@ -59,7 +64,7 @@ describe("CaseFileActions", () => {
5964 } ) ;
6065
6166 it ( "handles Unlink from Case File click" , ( ) => {
62- mountComponent ( "open" ) ;
67+ mountComponent ( CaseFileStatusEnum . OPEN ) ;
6368 cy . contains ( "button" , "Actions" ) . click ( ) ;
6469 cy . contains ( "Unlink from Case File" ) . click ( ) ;
6570
@@ -71,7 +76,7 @@ describe("CaseFileActions", () => {
7176 } ) ;
7277
7378 it ( "handles Close Case File click" , ( ) => {
74- mountComponent ( "open" ) ;
79+ mountComponent ( CaseFileStatusEnum . OPEN ) ;
7580 cy . contains ( "button" , "Actions" ) . click ( ) ;
7681 cy . contains ( "Close Case File" ) . click ( ) ;
7782
@@ -85,7 +90,7 @@ describe("CaseFileActions", () => {
8590 } ) ;
8691
8792 it ( "handles Delete Case File click" , ( ) => {
88- mountComponent ( "open" ) ;
93+ mountComponent ( CaseFileStatusEnum . OPEN ) ;
8994 cy . contains ( "button" , "Actions" ) . click ( ) ;
9095 cy . contains ( "Delete Case File" ) . click ( ) ;
9196
@@ -99,7 +104,7 @@ describe("CaseFileActions", () => {
99104 } ) ;
100105
101106 it ( "handles Reopen Case File click" , ( ) => {
102- mountComponent ( "closed" ) ;
107+ mountComponent ( CaseFileStatusEnum . CLOSED ) ;
103108 cy . contains ( "button" , "Actions" ) . click ( ) ;
104109 cy . contains ( "Reopen Case File" ) . click ( ) ;
105110
0 commit comments