Loading files
126616f26This file is pinned to the selected release. Download the original to open it in your design tool.
import { render, screen } from '@testing-library/react'
import { describe, expect, it } from 'vitest'
import { I18nProvider } from '@/app/i18n-provider'
import { OperationStatus } from '@/components/stackchan/operation-status'
import { AppError } from '@/lib/errors/app-error'
describe('OperationStatus', () => {
it('renders progress and persistent status text', () => {
render(
<I18nProvider>
<OperationStatus state={{ status: 'pending', message: '書き込み中', progress: 0.42 }} />
</I18nProvider>
)
expect(screen.getByText('処理中')).toBeInTheDocument()
expect(screen.getByText('書き込み中')).toBeInTheDocument()
expect(screen.getByRole('progressbar')).toHaveAttribute('aria-valuenow', '42')
})
it('keeps errors in an alert', () => {
render(
<I18nProvider>
<OperationStatus state={{ status: 'error', error: new AppError('write', '接続が切れました') }} />
</I18nProvider>
)
expect(screen.getByRole('alert')).toHaveTextContent('接続が切れました')
})
})
Files from this revision, including CAD and LFS contents. Git history is not included.
Or in GitHub Desktop, choose File → Clone repository → URL and paste this address.
Public repositories can be cloned without signing in. For pushing, use your ThingAtlas username and a Git access token as the password.
git lfs install git clone https://thingatlas.com/git/-unclaimed/stack-chan-374381865.git
Includes Git history, branches, and Git LFS files. Clones the repository’s default branch, regardless of the version shown here.
126616f26This file is pinned to the selected release. Download the original to open it in your design tool.