feat(Chat Trigger Node): Add support for file uploads & harmonize public and development chat (#9802)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
oleg
2024-07-09 13:45:41 +02:00
committed by GitHub
parent 501bcd80ff
commit df783151b8
32 changed files with 2309 additions and 940 deletions

View File

@@ -32,12 +32,29 @@ describe('useClipboard()', () => {
userEvent.setup();
});
beforeEach(() => {
// Mock document.execCommand implementation to set clipboard items
document.execCommand = vi.fn().mockImplementation((command) => {
if (command === 'copy') {
Object.defineProperty(window.navigator, 'clipboard', {
value: { items: [testValue] },
configurable: true,
});
}
return true;
});
});
afterEach(() => {
vi.restoreAllMocks();
});
describe('copy()', () => {
it('should copy text value', async () => {
const { getByTestId } = render(TestComponent);
const copyButton = getByTestId('copy');
copyButton.click();
await userEvent.click(copyButton);
expect((window.navigator.clipboard as unknown as { items: string[] }).items).toHaveLength(1);
});
});