Skip to content

Commit

Permalink
Merge pull request #1494 from bcgov/fix/alex-workflow-tests-241217
Browse files Browse the repository at this point in the history
Fix: Workflow Checks
  • Loading branch information
AlexZorkin authored Dec 18, 2024
2 parents af3cbd2 + 7041eb7 commit be97282
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/docker-auto-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
- name: Run backend tests
id: backend_tests
continue-on-error: true
run: |
cd backend
poetry run pytest --junitxml=pytest-results.xml
Expand Down Expand Up @@ -124,7 +123,6 @@ jobs:
- name: Run frontend tests
id: frontend_tests
continue-on-error: true
run: |
cd frontend
npm run test:run -- --reporter=junit --outputFile=vitest-results.xml
Expand All @@ -148,4 +146,4 @@ jobs:
check_name: "Frontend Test Results"
fail_on: "errors"
report_individual_runs: "true"
deduplicate_classes_by_file_name: "true"
deduplicate_classes_by_file_name: "true"
18 changes: 11 additions & 7 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx

import React from 'react'
import { render, screen, fireEvent, waitFor } from '@testing-library/react'
import { render, screen } from '@testing-library/react'
import { describe, it, expect, beforeEach, vi } from 'vitest'
import { AddEditAllocationAgreements } from '../AddEditAllocationAgreements'
import * as useAllocationAgreementHook from '@/hooks/useAllocationAgreement'
Expand All @@ -12,6 +12,19 @@ const mockUseLocation = vi.fn()
const mockUseNavigate = vi.fn()
const mockUseParams = vi.fn()

vi.mock('@react-keycloak/web', () => ({
ReactKeycloakProvider: ({ children }) => children,
useKeycloak: () => ({
keycloak: {
authenticated: true,
login: vi.fn(),
logout: vi.fn(),
register: vi.fn()
},
initialized: true
})
}))

vi.mock('react-router-dom', () => ({
...vi.importActual('react-router-dom'),
useLocation: () => mockUseLocation(),
Expand Down

0 comments on commit be97282

Please sign in to comment.