mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 14:04:41 -07:00
refactor(cli): integrate real config loading into async test utils (#23040)
This commit is contained in:
committed by
GitHub
parent
7de0616229
commit
23264ced9a
@@ -16,8 +16,8 @@ describe('useTips()', () => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it('should return false and call set(1) if state is undefined', () => {
|
||||
const { result } = renderHookWithProviders(() => useTips());
|
||||
it('should return false and call set(1) if state is undefined', async () => {
|
||||
const { result } = await renderHookWithProviders(() => useTips());
|
||||
|
||||
expect(result.current.showTips).toBe(true);
|
||||
|
||||
@@ -25,20 +25,20 @@ describe('useTips()', () => {
|
||||
expect(persistentStateMock.get('tipsShown')).toBe(1);
|
||||
});
|
||||
|
||||
it('should return false and call set(6) if state is 5', () => {
|
||||
it('should return false and call set(6) if state is 5', async () => {
|
||||
persistentStateMock.setData({ tipsShown: 5 });
|
||||
|
||||
const { result } = renderHookWithProviders(() => useTips());
|
||||
const { result } = await renderHookWithProviders(() => useTips());
|
||||
|
||||
expect(result.current.showTips).toBe(true);
|
||||
|
||||
expect(persistentStateMock.get('tipsShown')).toBe(6);
|
||||
});
|
||||
|
||||
it('should return true if state is 10', () => {
|
||||
it('should return true if state is 10', async () => {
|
||||
persistentStateMock.setData({ tipsShown: 10 });
|
||||
|
||||
const { result } = renderHookWithProviders(() => useTips());
|
||||
const { result } = await renderHookWithProviders(() => useTips());
|
||||
|
||||
expect(result.current.showTips).toBe(false);
|
||||
expect(persistentStateMock.set).not.toHaveBeenCalled();
|
||||
|
||||
Reference in New Issue
Block a user