diff --git a/lib/clipboard.class.e2e.spec.ts b/lib/clipboard.class.e2e.spec.ts index c1844258..eef79f47 100644 --- a/lib/clipboard.class.e2e.spec.ts +++ b/lib/clipboard.class.e2e.spec.ts @@ -7,7 +7,7 @@ describe("Clipboard class", () => { const textToCopy = "bar"; - SUT.copy(textToCopy); - await expect(SUT.paste()).resolves.toEqual(textToCopy); + SUT.setContent(textToCopy); + await expect(SUT.getContent()).resolves.toEqual(textToCopy); }); }); diff --git a/lib/clipboard.class.spec.ts b/lib/clipboard.class.spec.ts index c7d282eb..2128ab3c 100644 --- a/lib/clipboard.class.spec.ts +++ b/lib/clipboard.class.spec.ts @@ -26,7 +26,7 @@ describe("Clipboard class", () => { const textToCopy = "bar"; // WHEN - SUT.copy(textToCopy); + SUT.setContent(textToCopy); // THEN expect(copyMock).toHaveBeenCalledTimes(1); @@ -45,7 +45,7 @@ describe("Clipboard class", () => { providerRegistryMock.getLogProvider = () => new NoopLogProvider(); // WHEN - SUT.paste(); + SUT.getContent(); // THEN expect(pasteMock).toHaveBeenCalledTimes(1); diff --git a/lib/clipboard.class.ts b/lib/clipboard.class.ts index 4b1bfbca..af621b88 100644 --- a/lib/clipboard.class.ts +++ b/lib/clipboard.class.ts @@ -11,18 +11,18 @@ export class ClipboardClass { constructor(private providerRegistry: ProviderRegistry) {} /** - * {@link copy} copies a given text to the system clipboard + * {@link setContent} copies a given text to the system clipboard * @param text The text to copy */ - public copy(text: string): Promise { + public setContent(text: string): Promise { this.providerRegistry.getLogProvider().debug(`Saving to clipboard`); return this.providerRegistry.getClipboard().copy(text); } /** - * {@link paste} returns the current content of the system clipboard (limited to text) + * {@link getContent} returns the current content of the system clipboard (limited to text) */ - public paste(): Promise { + public getContent(): Promise { this.providerRegistry.getLogProvider().debug(`Fetching clipboard content`); return this.providerRegistry.getClipboard().paste(); }