Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
27
frontend/tests/oauthEditorDirtyState.test.ts
Normal file
27
frontend/tests/oauthEditorDirtyState.test.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { describe, expect, test } from 'vitest';
|
||||
import {
|
||||
getModelAliasDraftSignature,
|
||||
getStringSetSignature,
|
||||
isOAuthEditorDirty,
|
||||
} from '../src/features/authFiles/oauthEditorState';
|
||||
|
||||
describe('OAuth editor dirty state', () => {
|
||||
test('compares model selections independent of order', () => {
|
||||
expect(getStringSetSignature(['b', 'a'])).toBe(getStringSetSignature(['a', 'b']));
|
||||
});
|
||||
|
||||
test('ignores generated row ids but preserves partial alias edits', () => {
|
||||
expect(getModelAliasDraftSignature([{ id: 'one', name: '', alias: '', fork: true }])).toBe(
|
||||
getModelAliasDraftSignature([])
|
||||
);
|
||||
expect(
|
||||
getModelAliasDraftSignature([{ id: 'one', name: 'partial', alias: '', fork: true }])
|
||||
).not.toBe(getModelAliasDraftSignature([]));
|
||||
});
|
||||
|
||||
test('marks provider or content changes as dirty', () => {
|
||||
expect(isOAuthEditorDirty('codex', 'codex', 'same', 'same')).toBe(false);
|
||||
expect(isOAuthEditorDirty('codex', 'claude', 'same', 'same')).toBe(true);
|
||||
expect(isOAuthEditorDirty('codex', 'codex', 'before', 'after')).toBe(true);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue