GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(web): cover unreferenced queued edit records in the open-edit case · pingdotgg/t3code@e83f8db

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/web/src/components/chat
    • useQueuedRunEdit.browser.test.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/web/src/components/chat/useQueuedRunEdit.browser.test.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/chat/useQueuedRunEdit.browser.test.tsx
+5-17Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,16 @@ describe("useQueuedRunEdit", () => {
277277
);
278278
});
279279

280-
it("opens an edit with the thread and machine records its mentions refer to", async () => {
280+
it("opens an edit with only the thread and machine records its text still mentions", async () => {
281281
const { hook } = setup();
282282
const thread = threadContextRecord(THREAD_B, "Support Any File Uploads");
283283
const machine = environmentContextRecord(ENV, "Build box");
284+
const unreferenced = threadContextRecord(THREAD_A, "Removed earlier");
284285
const messageId = MessageId.make("message-1");
285286
const text = `wait for ${formatInlineContextReference(threadContextReference(thread))} on ${formatInlineContextReference(environmentContextReference(machine))}`;
286-
const messages = [{ id: messageId, text, context: { version: 1, records: [thread, machine] } }];
287+
const messages = [
288+
{ id: messageId, text, context: { version: 1, records: [thread, machine, unreferenced] } },
289+
];
287290
await using _screen = await render(view(THREAD_A, "queued", hook, messages));
288291

289292
await act(() => requireHook(hook).beginEdit({ runId: RUN, messageId, text, attachments: [] }));
@@ -294,21 +297,6 @@ describe("useQueuedRunEdit", () => {
294297
expect(draft?.environmentContexts).toEqual([machine]);
295298
});
296299

297-
it("opens an edit without records the message text no longer mentions", async () => {
298-
const { hook } = setup();
299-
const unreferenced = threadContextRecord(THREAD_B, "Removed earlier");
300-
const messageId = MessageId.make("message-1");
301-
const text = "plain text";
302-
const messages = [{ id: messageId, text, context: { version: 1, records: [unreferenced] } }];
303-
await using _screen = await render(view(THREAD_A, "queued", hook, messages));
304-
305-
await act(() => requireHook(hook).beginEdit({ runId: RUN, messageId, text, attachments: [] }));
306-
307-
const draft = useComposerDraftStore.getState().getComposerDraft(requireHook(hook).draftTarget);
308-
expect(draft?.prompt).toBe(text);
309-
expect(draft?.threadContexts).toEqual([]);
310-
});
311-
312300
it("saves only the thread mentions still in the edited message", async () => {
313301
const { hook } = setup();
314302
mocks.editQueuedRun.mockResolvedValue({ _tag: "Success" });

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.