feat: add big fish runtime rules entry

This commit is contained in:
2026-04-26 21:41:20 +08:00
parent c81305f2e6
commit 7694ef5723
3 changed files with 104 additions and 3 deletions

View File

@@ -77,4 +77,23 @@ describe('BigFishRuntimeShell', () => {
fireEvent.click(screen.getByRole('button', { name: '退出' }));
expect(onBack).toHaveBeenCalledTimes(1);
});
test('opens and closes the runtime rule modal', () => {
render(
<BigFishRuntimeShell
run={createRun('running')}
onBack={() => {}}
onSubmitInput={() => {}}
/>,
);
fireEvent.click(screen.getByRole('button', { name: '查看规则' }));
expect(screen.getByRole('dialog', { name: '玩法规则' })).toBeTruthy();
expect(screen.getByText('低级或同级野生实体会被收编。')).toBeTruthy();
fireEvent.click(screen.getByRole('button', { name: '关闭' }));
expect(screen.queryByRole('dialog', { name: '玩法规则' })).toBeNull();
});
});