Skip to content

Commit 36f446e

Browse files
Rajgupta36arkid15rkasya
committed
UI/ux mentorship admin (#2288)
* Improve UI/UX * update button padding * fix unit test cases * fix suggestions * Update docker-compose/local.yaml * UI/ux mentorship program update (#2244) * fix ui bugs * update format * fix test cases * fix test cases * update UI * update UI * update line clamp property * fix test case * Update styling --------- Co-authored-by: Kate Golovanova <kate@kgthreads.com> Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com> * fix conflicts * update ui * fix bugs * updated focus ring * format fix * Update docker-compose/local.yaml * UI/ux mentorship program update (#2244) * fix ui bugs * update format * fix test cases * fix test cases * update UI * update UI * update line clamp property * fix test case * Update styling --------- Co-authored-by: Kate Golovanova <kate@kgthreads.com> Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com> * fix params and remove refresh params (#2287) * Update docker-compose/local.yaml * UI/ux mentorship program update (#2244) * fix ui bugs * update format * fix test cases * fix test cases * update UI * update UI * update line clamp property * fix test case * Update styling --------- Co-authored-by: Kate Golovanova <kate@kgthreads.com> Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com> * fix params and remove refresh params * update direct cache * fix test cases * better exception caching * update logic Update docker-compose/local.yaml UI/ux mentorship program update (#2244) * fix ui bugs * update format * fix test cases * fix test cases * update UI * update UI * update line clamp property * fix test case * Update styling --------- Co-authored-by: Kate Golovanova <kate@kgthreads.com> Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com> * Update apollo cache logic on updating programs and modules * restore files * fix test cases * fix test cases * update button to link * fix type --------- Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org> Co-authored-by: Kate Golovanova <kate@kgthreads.com> Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com> * update button --------- Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org> Co-authored-by: Kate Golovanova <kate@kgthreads.com> Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>
1 parent f86e815 commit 36f446e

16 files changed

Lines changed: 375 additions & 138 deletions

File tree

frontend/__tests__/unit/components/ProgramActions.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('ProgramActions', () => {
4343
})
4444

4545
test('renders and toggles dropdown', () => {
46-
render(<ProgramActions status="DRAFT" setStatus={setStatus} />)
46+
render(<ProgramActions programKey="test-program" status="DRAFT" setStatus={setStatus} />)
4747
const button = screen.getByTestId('program-actions-button')
4848
fireEvent.click(button)
4949
expect(screen.getByText('Add Module')).toBeInTheDocument()
@@ -53,7 +53,7 @@ describe('ProgramActions', () => {
5353
})
5454

5555
test('handles Add Module action', () => {
56-
render(<ProgramActions status="DRAFT" setStatus={setStatus} />)
56+
render(<ProgramActions programKey="test-program" status="DRAFT" setStatus={setStatus} />)
5757
const button = screen.getByTestId('program-actions-button')
5858
fireEvent.click(button)
5959
fireEvent.click(screen.getByRole('menuitem', { name: /add module/i }))
@@ -62,7 +62,7 @@ describe('ProgramActions', () => {
6262
})
6363

6464
test('handles Publish action', () => {
65-
render(<ProgramActions status="DRAFT" setStatus={setStatus} />)
65+
render(<ProgramActions programKey="test-program" status="DRAFT" setStatus={setStatus} />)
6666
const button = screen.getByTestId('program-actions-button')
6767
fireEvent.click(button)
6868
fireEvent.click(screen.getByRole('menuitem', { name: /publish program/i }))
@@ -71,15 +71,15 @@ describe('ProgramActions', () => {
7171
})
7272

7373
test('handles Move to Draft action', () => {
74-
render(<ProgramActions status="PUBLISHED" setStatus={setStatus} />)
74+
render(<ProgramActions programKey="test-program" status="PUBLISHED" setStatus={setStatus} />)
7575
const button = screen.getByTestId('program-actions-button')
7676
fireEvent.click(button)
7777
fireEvent.click(screen.getByRole('menuitem', { name: /move to draft/i }))
7878
expect(setStatus).toHaveBeenCalledWith(ProgramStatusEnum.Draft)
7979
})
8080

8181
test('handles Mark as Completed action', () => {
82-
render(<ProgramActions status="PUBLISHED" setStatus={setStatus} />)
82+
render(<ProgramActions programKey="test-program" status="PUBLISHED" setStatus={setStatus} />)
8383
const button = screen.getByTestId('program-actions-button')
8484
fireEvent.click(button)
8585
fireEvent.click(screen.getByRole('menuitem', { name: /mark as completed/i }))
@@ -89,7 +89,7 @@ describe('ProgramActions', () => {
8989
test('dropdown closes on outside click', () => {
9090
render(
9191
<div>
92-
<ProgramActions status="DRAFT" setStatus={setStatus} />
92+
<ProgramActions programKey="test-program" status="DRAFT" setStatus={setStatus} />
9393
<button data-testid="outside">Outside</button>
9494
</div>
9595
)

0 commit comments

Comments
 (0)