Add QA test outputs, build scripts, and Dockerfile validation

- Created `qa-test-output-after-fix.txt` and `qa-test-output.txt` to log results of certificate page authentication tests.
- Added `build.sh` for deterministic backend builds in CI, utilizing `go list` for efficiency.
- Introduced `codeql_scan.sh` for CodeQL database creation and analysis for Go and JavaScript/TypeScript.
- Implemented `dockerfile_check.sh` to validate Dockerfiles for base image and package manager mismatches.
- Added `sourcery_precommit_wrapper.sh` to facilitate Sourcery CLI usage in pre-commit hooks.
This commit is contained in:
GitHub Actions
2025-12-11 18:26:24 +00:00
parent 65d837a13f
commit 8294d6ee49
609 changed files with 111623 additions and 0 deletions
@@ -0,0 +1,60 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'
import { screen } from '@testing-library/react'
import Dashboard from '../Dashboard'
import { renderWithQueryClient } from '../../test-utils/renderWithQueryClient'
vi.mock('../../hooks/useProxyHosts', () => ({
useProxyHosts: () => ({
hosts: [
{ id: 1, enabled: true },
{ id: 2, enabled: false },
],
}),
}))
vi.mock('../../hooks/useRemoteServers', () => ({
useRemoteServers: () => ({
servers: [
{ id: 1, enabled: true },
{ id: 2, enabled: true },
],
}),
}))
vi.mock('../../hooks/useCertificates', () => ({
useCertificates: () => ({
certificates: [
{ id: 1, status: 'valid' },
{ id: 2, status: 'expired' },
],
}),
}))
vi.mock('../../api/health', () => ({
checkHealth: vi.fn().mockResolvedValue({ status: 'ok', version: '1.0.0' }),
}))
describe('Dashboard page', () => {
beforeEach(() => {
vi.clearAllMocks()
})
it('renders counts and health status', async () => {
renderWithQueryClient(<Dashboard />)
expect(await screen.findByText('Dashboard')).toBeInTheDocument()
expect(await screen.findByText('1 enabled')).toBeInTheDocument()
expect(screen.getByText('2 enabled')).toBeInTheDocument()
expect(screen.getByText('1 valid')).toBeInTheDocument()
expect(await screen.findByText('Healthy')).toBeInTheDocument()
})
it('shows error state when health check fails', async () => {
const { checkHealth } = await import('../../api/health')
vi.mocked(checkHealth).mockResolvedValueOnce({ status: 'fail', version: '1.0.0' } as never)
renderWithQueryClient(<Dashboard />)
expect(await screen.findByText('Error')).toBeInTheDocument()
})
})