Forge success label and real progress bar tied to server compile stages.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Replace Dispensed with Forged in the reveal modal, poll builder/progress with indeterminate-until-first-byte UX, and emit interpolated compile progress during long garble builds.
This commit is contained in:
36
server/web/src/components/Forge/ForgeDispenseReveal.test.tsx
Normal file
36
server/web/src/components/Forge/ForgeDispenseReveal.test.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @vitest-environment happy-dom
|
||||
*/
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import ForgeDispenseReveal from './ForgeDispenseReveal';
|
||||
|
||||
vi.mock('../../context/AmbientMusicContext', () => ({
|
||||
useModalAmbientDuck: () => {},
|
||||
}));
|
||||
|
||||
vi.mock('../../context/SoundContext', () => ({
|
||||
useSound: () => ({ play: vi.fn() }),
|
||||
}));
|
||||
|
||||
vi.mock('../DownloadButton', () => ({
|
||||
default: ({ children }: { children: React.ReactNode }) => <button type="button">{children}</button>,
|
||||
}));
|
||||
|
||||
describe('ForgeDispenseReveal', () => {
|
||||
it('shows Forged title on successful forge', () => {
|
||||
render(
|
||||
<ForgeDispenseReveal
|
||||
result={{
|
||||
success: true,
|
||||
file_name: 'worker.exe',
|
||||
download_url: '/api/v1/builds/x/download',
|
||||
stealth_score: 72,
|
||||
}}
|
||||
onClose={() => {}}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByRole('heading', { name: 'Forged' })).toBeInTheDocument();
|
||||
expect(screen.queryByText('Dispensed')).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user