@@ -42,7 +42,7 @@ describe('ProgramActions', () => {
42
42
} )
43
43
44
44
test ( 'renders and toggles dropdown' , ( ) => {
45
- render ( < ProgramActions status = "DRAFT" setStatus = { setStatus } /> )
45
+ render ( < ProgramActions programKey = "test-program" status = "DRAFT" setStatus = { setStatus } /> )
46
46
const button = screen . getByTestId ( 'program-actions-button' )
47
47
fireEvent . click ( button )
48
48
expect ( screen . getByText ( 'Add Module' ) ) . toBeInTheDocument ( )
@@ -52,7 +52,7 @@ describe('ProgramActions', () => {
52
52
} )
53
53
54
54
test ( 'handles Add Module action' , ( ) => {
55
- render ( < ProgramActions status = "DRAFT" setStatus = { setStatus } /> )
55
+ render ( < ProgramActions programKey = "test-program" status = "DRAFT" setStatus = { setStatus } /> )
56
56
const button = screen . getByTestId ( 'program-actions-button' )
57
57
fireEvent . click ( button )
58
58
fireEvent . click ( screen . getByRole ( 'menuitem' , { name : / a d d m o d u l e / i } ) )
@@ -61,7 +61,7 @@ describe('ProgramActions', () => {
61
61
} )
62
62
63
63
test ( 'handles Publish action' , ( ) => {
64
- render ( < ProgramActions status = "DRAFT" setStatus = { setStatus } /> )
64
+ render ( < ProgramActions programKey = "test-program" status = "DRAFT" setStatus = { setStatus } /> )
65
65
const button = screen . getByTestId ( 'program-actions-button' )
66
66
fireEvent . click ( button )
67
67
fireEvent . click ( screen . getByRole ( 'menuitem' , { name : / p u b l i s h p r o g r a m / i } ) )
@@ -70,15 +70,15 @@ describe('ProgramActions', () => {
70
70
} )
71
71
72
72
test ( 'handles Move to Draft action' , ( ) => {
73
- render ( < ProgramActions status = "PUBLISHED" setStatus = { setStatus } /> )
73
+ render ( < ProgramActions programKey = "test-program" status = "PUBLISHED" setStatus = { setStatus } /> )
74
74
const button = screen . getByTestId ( 'program-actions-button' )
75
75
fireEvent . click ( button )
76
76
fireEvent . click ( screen . getByRole ( 'menuitem' , { name : / m o v e t o d r a f t / i } ) )
77
77
expect ( setStatus ) . toHaveBeenCalledWith ( 'DRAFT' )
78
78
} )
79
79
80
80
test ( 'handles Mark as Completed action' , ( ) => {
81
- render ( < ProgramActions status = "PUBLISHED" setStatus = { setStatus } /> )
81
+ render ( < ProgramActions programKey = "test-program" status = "PUBLISHED" setStatus = { setStatus } /> )
82
82
const button = screen . getByTestId ( 'program-actions-button' )
83
83
fireEvent . click ( button )
84
84
fireEvent . click ( screen . getByRole ( 'menuitem' , { name : / m a r k a s c o m p l e t e d / i } ) )
@@ -88,7 +88,7 @@ describe('ProgramActions', () => {
88
88
test ( 'dropdown closes on outside click' , ( ) => {
89
89
render (
90
90
< div >
91
- < ProgramActions status = "DRAFT" setStatus = { setStatus } />
91
+ < ProgramActions programKey = "test-program" status = "DRAFT" setStatus = { setStatus } />
92
92
< button data-testid = "outside" > Outside</ button >
93
93
</ div >
94
94
)
0 commit comments