Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(composer): fold large pastes into attachments #10823

Closedchrisdeeming(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/10823/headopened View on GitHub

Showing 45 changed files with 44 additions and 0 deletions (loading 42).

x
0 of 45 viewed, 45 left
24 additions and 0 deletionsapps/desktop/src/ipc/methods/window.test.tsModified
View file
@@ -13,6 +13,7 @@
import {
getLocalEnvironmentBootstraps,
getWindowFullscreenState,
+ pasteAsText,
pickProjectFavicon,
} from "./window.ts";
​
@@ -153,6 +154,29 @@
});
});
​
+describe("pasteAsText", () => {
+ it.effect("pastes only after the main renderer acknowledges the menu action", () => {
+ const paste = vi.fn();
+ const window = {
+ webContents: { id: 42, paste },
+ } as unknown as Electron.BrowserWindow;
+​
+ return Effect.gen(function* () {
+ yield* pasteAsText.handler(undefined, { sender: { id: 42 } });
+ assert.equal(paste.mock.calls.length, 1);
+​
+ yield* pasteAsText.handler(undefined, { sender: { id: 99 } });
+ assert.equal(paste.mock.calls.length, 1);
+ }).pipe(
+ Effect.provide(
+ Layer.mock(ElectronWindow.ElectronWindow)({
+ main: Effect.succeed(Option.some(window)),