feat: update Makelore modules and conversations
This commit is contained in:
@@ -50,7 +50,6 @@ function renderCommandHook(
|
||||
const actions = {
|
||||
rename: vi.fn<ChatCommandActions['rename']>().mockResolvedValue(undefined),
|
||||
timeline: vi.fn<ChatCommandActions['timeline']>(),
|
||||
fork: vi.fn<ChatCommandActions['fork']>().mockResolvedValue(undefined),
|
||||
compact: vi.fn<ChatCommandActions['compact']>().mockResolvedValue(undefined),
|
||||
share: vi.fn<ChatCommandActions['share']>().mockImplementation(async () => {
|
||||
context.shared = true;
|
||||
@@ -63,6 +62,7 @@ function renderCommandHook(
|
||||
toggleTimestamps:
|
||||
vi.fn<ChatCommandActions['toggleTimestamps']>(),
|
||||
toggleThinking: vi.fn<ChatCommandActions['toggleThinking']>(),
|
||||
toggleProcess: vi.fn<ChatCommandActions['toggleProcess']>(),
|
||||
copy: vi.fn<ChatCommandActions['copy']>().mockResolvedValue(undefined),
|
||||
export: vi.fn<ChatCommandActions['export']>().mockResolvedValue(undefined),
|
||||
project: vi.fn<ChatCommandActions['project']>().mockResolvedValue({
|
||||
@@ -239,13 +239,6 @@ describe('useChatCommands', () => {
|
||||
});
|
||||
fixture.result.current.cancelDialog();
|
||||
|
||||
await fixture.run('/fork');
|
||||
expect(fixture.result.current.dialog).toEqual({
|
||||
kind: 'fork',
|
||||
originatingDraft: '/fork',
|
||||
});
|
||||
fixture.result.current.cancelDialog();
|
||||
|
||||
await fixture.run('/compact');
|
||||
expect(fixture.actions.compact).toHaveBeenCalledOnce();
|
||||
|
||||
@@ -275,6 +268,9 @@ describe('useChatCommands', () => {
|
||||
await fixture.run('/thinking');
|
||||
expect(fixture.actions.toggleThinking).toHaveBeenCalledOnce();
|
||||
|
||||
await fixture.run('/process');
|
||||
expect(fixture.actions.toggleProcess).toHaveBeenCalledOnce();
|
||||
|
||||
await fixture.run('/copy');
|
||||
expect(fixture.actions.copy).toHaveBeenCalledOnce();
|
||||
|
||||
@@ -343,26 +339,6 @@ describe('useChatCommands', () => {
|
||||
expect(fixture.actions.undo).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('runs a fork selection as a single flight', async () => {
|
||||
const deferred = Promise.withResolvers<void>();
|
||||
const fixture = renderCommandHook('/fork');
|
||||
fixture.actions.fork.mockReturnValue(deferred.promise);
|
||||
await act(async () => fixture.result.current.tryExecuteDraft());
|
||||
|
||||
let first!: Promise<void>;
|
||||
let second!: Promise<void>;
|
||||
act(() => {
|
||||
first = fixture.result.current.selectTimelineMessage('msg-user');
|
||||
second = fixture.result.current.selectTimelineMessage('msg-user');
|
||||
});
|
||||
expect(fixture.actions.fork).toHaveBeenCalledOnce();
|
||||
|
||||
deferred.resolve();
|
||||
await act(async () => {
|
||||
await Promise.all([first, second]);
|
||||
});
|
||||
});
|
||||
|
||||
it('does not clear an identical current draft when a project command is cancelled', async () => {
|
||||
const fixture = renderCommandHook('/Review same text');
|
||||
fixture.actions.project.mockResolvedValueOnce({ status: 'cancelled' });
|
||||
|
||||
Reference in New Issue
Block a user