// FE-COMP-MSTORETEST-001 to FE-COMP-MSTORETEST-004 import { describe, expect, it } from 'vitest'; import { render, screen } from '../../../tests/helpers/render'; import MStorageTestResult from './MStorageTestResult'; describe('MStorageTestResult', () => { it('FE-COMP-MSTORETEST-001: renders nothing before the first test', () => { const { container } = render(); expect(container).toBeEmptyDOMElement(); }); it('FE-COMP-MSTORETEST-002: shows the running note while a test is in flight', () => { render(); expect(screen.getByText('Testing…')).toHaveClass('mt-2', 'font-geist', 'text-m-muted'); }); it('FE-COMP-MSTORETEST-003: lists every target under a passed verdict', () => { render(); expect(screen.getByText('Connection OK')).toHaveClass('font-bold', 'text-m-ink'); expect(screen.getByText(/off-box/).textContent).toBe('✓ off-box'); }); it('FE-COMP-MSTORETEST-004: marks a failed target and appends its error', () => { render( ); expect(screen.getByText('Test failed')).toBeInTheDocument(); expect(screen.getByText(/primary/).textContent).toBe('✓ primary'); expect(screen.getByText(/replica/).textContent).toBe('✗ replica — timeout'); }); });