Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ jobs:
with:
python-version: "3.11"
- name: Install backend system dependencies
run: sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
run: |
sudo rm -f /etc/apt/sources.list.d/azure-cli.sources /etc/apt/sources.list.d/azure-cli.list /etc/apt/sources.list.d/microsoft-prod.sources /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
- name: Install backend development dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -96,7 +98,9 @@ jobs:
with:
python-version: "3.11"
- name: Install backend system dependencies
run: sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
run: |
sudo rm -f /etc/apt/sources.list.d/azure-cli.sources /etc/apt/sources.list.d/azure-cli.list /etc/apt/sources.list.d/microsoft-prod.sources /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
- name: Install backend dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -118,7 +122,9 @@ jobs:
with:
python-version: "3.11"
- name: Install backend system dependencies
run: sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
run: |
sudo rm -f /etc/apt/sources.list.d/azure-cli.sources /etc/apt/sources.list.d/azure-cli.list /etc/apt/sources.list.d/microsoft-prod.sources /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
- name: Install backend dependencies
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -147,7 +153,9 @@ jobs:
with:
python-version: "3.11"
- name: Install backend system dependencies
run: sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
run: |
sudo rm -f /etc/apt/sources.list.d/azure-cli.sources /etc/apt/sources.list.d/azure-cli.list /etc/apt/sources.list.d/microsoft-prod.sources /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
- name: Install backend dependencies
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -178,7 +186,9 @@ jobs:
with:
python-version: "3.11"
- name: Install backend system dependencies
run: sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
run: |
sudo rm -f /etc/apt/sources.list.d/azure-cli.sources /etc/apt/sources.list.d/azure-cli.list /etc/apt/sources.list.d/microsoft-prod.sources /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
- name: Install backend dependencies
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -227,7 +237,9 @@ jobs:
with:
python-version: "3.11"
- name: Install backend system dependencies
run: sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
run: |
sudo rm -f /etc/apt/sources.list.d/azure-cli.sources /etc/apt/sources.list.d/azure-cli.list /etc/apt/sources.list.d/microsoft-prod.sources /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update && sudo apt-get install -y libcairo2-dev pkg-config
- name: Install backend dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface BackgroundProps {

export default function Background({ state = 'idle' }: BackgroundProps) {
return (
<div className={`background background--${state}`}>
<div className={`background background--${state}`} aria-hidden="true">
<div className="background-grid" />
<div className="background-scan" />
<div className="background-lines" />
Expand Down
34 changes: 34 additions & 0 deletions frontend/testing/unit/components/Background.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react'
import { render } from '@testing-library/react'
import { describe, it, expect } from 'vitest'
import Background from '../../../src/components/Background'

describe('Background Component', () => {
it('renders without crashing with default props', () => {
const { container } = render(<Background />)
const wrapper = container.querySelector('.background')
expect(wrapper).toBeInTheDocument()
expect(wrapper).toHaveClass('background--idle')
})

it('renders with different state props', () => {
const { container: activeContainer } = render(<Background state="active" />)
expect(activeContainer.querySelector('.background')).toHaveClass('background--active')

const { container: errorContainer } = render(<Background state="error" />)
expect(errorContainer.querySelector('.background')).toHaveClass('background--error')
})

it('asserts decorative container and layers are aria-hidden', () => {
const { container } = render(<Background />)

// The main wrapper should be aria-hidden since it is decorative background
const wrapper = container.querySelector('.background')
expect(wrapper).toHaveAttribute('aria-hidden', 'true')

// Confirm that the decorative internal elements exist as well
expect(container.querySelector('.background-grid')).toBeInTheDocument()
expect(container.querySelector('.background-scan')).toBeInTheDocument()
expect(container.querySelector('.background-lines')).toBeInTheDocument()
})
})
Loading