mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Make Nostr Auth work
This commit is contained in:
13 files changed
+152
-113
No files matched your search
@@ -2,18 +2,27 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import { renderHook } from '@testing-library/react';
|
||||
import { useAIProjectId } from './useAIProjectId';
|
||||
import { useAISettings } from './useAISettings';
|
||||
import { useCurrentUser } from './useCurrentUser';
|
||||
|
||||
// Mock the useAISettings hook
|
||||
// Mock the hooks
|
||||
vi.mock('./useAISettings');
|
||||
vi.mock('./useCurrentUser');
|
||||
|
||||
describe('useAIProjectId', () => {
|
||||
const mockUseAISettings = vi.mocked(useAISettings);
|
||||
const mockUseCurrentUser = vi.mocked(useCurrentUser);
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
|
||||
// Mock fetch globally
|
||||
global.fetch = vi.fn();
|
||||
|
||||
// Mock useCurrentUser to return undefined user by default
|
||||
mockUseCurrentUser.mockReturnValue({
|
||||
user: undefined,
|
||||
users: [],
|
||||
});
|
||||
});
|
||||
|
||||
it('should return not configured when AI settings are not configured', () => {
|
||||
|
||||
Reference in new issue
Block a user