mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 23:44:22 +00:00
Refactor tests to remove redundant settings mock data
This commit is contained in:
@@ -238,7 +238,7 @@ describe('LoginPage', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('handles special characters in credentials', async () => {
|
it('handles special characters in credentials', async () => {
|
||||||
render(<LoginPage />);
|
await render(<LoginPage />);
|
||||||
|
|
||||||
const specialEmail = 'user+test@example-domain.com';
|
const specialEmail = 'user+test@example-domain.com';
|
||||||
const specialPassword = 'P@ssw0rd!#$%';
|
const specialPassword = 'P@ssw0rd!#$%';
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ describe('WorkspaceSwitcher', () => {
|
|||||||
vi.mocked(useWorkspace).mockReturnValue({
|
vi.mocked(useWorkspace).mockReturnValue({
|
||||||
currentWorkspace: mockCurrentWorkspace,
|
currentWorkspace: mockCurrentWorkspace,
|
||||||
workspaces: [],
|
workspaces: [],
|
||||||
settings: mockCurrentWorkspace,
|
|
||||||
updateSettings: vi.fn(),
|
updateSettings: vi.fn(),
|
||||||
loading: false,
|
loading: false,
|
||||||
colorScheme: 'light',
|
colorScheme: 'light',
|
||||||
@@ -137,7 +136,6 @@ describe('WorkspaceSwitcher', () => {
|
|||||||
vi.mocked(useWorkspace).mockReturnValue({
|
vi.mocked(useWorkspace).mockReturnValue({
|
||||||
currentWorkspace: null,
|
currentWorkspace: null,
|
||||||
workspaces: [],
|
workspaces: [],
|
||||||
settings: mockCurrentWorkspace,
|
|
||||||
updateSettings: vi.fn(),
|
updateSettings: vi.fn(),
|
||||||
loading: false,
|
loading: false,
|
||||||
colorScheme: 'light',
|
colorScheme: 'light',
|
||||||
|
|||||||
@@ -118,23 +118,6 @@ describe('DangerZoneSettings (Workspace)', () => {
|
|||||||
gitCommitEmail: '',
|
gitCommitEmail: '',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
settings: {
|
|
||||||
id: 1,
|
|
||||||
userId: 1,
|
|
||||||
name: 'Test Workspace',
|
|
||||||
createdAt: '2024-01-01T00:00:00Z',
|
|
||||||
theme: Theme.Light,
|
|
||||||
autoSave: false,
|
|
||||||
showHiddenFiles: false,
|
|
||||||
gitEnabled: false,
|
|
||||||
gitUrl: '',
|
|
||||||
gitUser: '',
|
|
||||||
gitToken: '',
|
|
||||||
gitAutoCommit: false,
|
|
||||||
gitCommitMsgTemplate: '',
|
|
||||||
gitCommitName: '',
|
|
||||||
gitCommitEmail: '',
|
|
||||||
},
|
|
||||||
updateSettings: vi.fn(),
|
updateSettings: vi.fn(),
|
||||||
loading: false,
|
loading: false,
|
||||||
colorScheme: 'light',
|
colorScheme: 'light',
|
||||||
@@ -193,23 +176,6 @@ describe('DangerZoneSettings (Workspace)', () => {
|
|||||||
gitCommitEmail: '',
|
gitCommitEmail: '',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
settings: {
|
|
||||||
id: 1,
|
|
||||||
userId: 1,
|
|
||||||
name: 'Last Workspace',
|
|
||||||
createdAt: '2024-01-01T00:00:00Z',
|
|
||||||
theme: Theme.Light,
|
|
||||||
autoSave: false,
|
|
||||||
showHiddenFiles: false,
|
|
||||||
gitEnabled: false,
|
|
||||||
gitUrl: '',
|
|
||||||
gitUser: '',
|
|
||||||
gitToken: '',
|
|
||||||
gitAutoCommit: false,
|
|
||||||
gitCommitMsgTemplate: '',
|
|
||||||
gitCommitName: '',
|
|
||||||
gitCommitEmail: '',
|
|
||||||
},
|
|
||||||
updateSettings: vi.fn(),
|
updateSettings: vi.fn(),
|
||||||
loading: false,
|
loading: false,
|
||||||
colorScheme: 'light',
|
colorScheme: 'light',
|
||||||
|
|||||||
@@ -102,23 +102,6 @@ describe('WorkspaceSettings', () => {
|
|||||||
gitCommitEmail: '',
|
gitCommitEmail: '',
|
||||||
},
|
},
|
||||||
workspaces: [],
|
workspaces: [],
|
||||||
settings: {
|
|
||||||
id: 1,
|
|
||||||
userId: 1,
|
|
||||||
name: 'Test Workspace',
|
|
||||||
createdAt: '2024-01-01T00:00:00Z',
|
|
||||||
theme: Theme.Light,
|
|
||||||
autoSave: false,
|
|
||||||
showHiddenFiles: false,
|
|
||||||
gitEnabled: false,
|
|
||||||
gitUrl: '',
|
|
||||||
gitUser: '',
|
|
||||||
gitToken: '',
|
|
||||||
gitAutoCommit: false,
|
|
||||||
gitCommitMsgTemplate: '',
|
|
||||||
gitCommitName: '',
|
|
||||||
gitCommitEmail: '',
|
|
||||||
},
|
|
||||||
updateSettings: mockUpdateSettings,
|
updateSettings: mockUpdateSettings,
|
||||||
loading: false,
|
loading: false,
|
||||||
colorScheme: 'light',
|
colorScheme: 'light',
|
||||||
|
|||||||
Reference in New Issue
Block a user