|
17 | 17 | run(async function () { |
18 | 18 | const { directLine, store } = testHelpers.createDirectLineEmulator(); |
19 | 19 |
|
20 | | - WebChat.renderWebChat( |
| 20 | + const { isFluentTheme } = renderWebChat( |
21 | 21 | { |
22 | 22 | directLine, |
23 | 23 | store, |
|
35 | 35 | // Keyboard interaction: try to tab to the upload button |
36 | 36 | await pageObjects.focusSendBoxTextBox(); |
37 | 37 | await host.sendTab(); |
38 | | - console.log('document.activeElement', document.activeElement); |
39 | 38 |
|
40 | 39 | expect(document.activeElement).not.toBe(pageElements.byTestId(WebChat.testIds.sendBoxUploadButton)); |
41 | 40 |
|
42 | 41 | // Simulate drag-and-drop using dispatchEvent |
43 | | - const sendBox = document.querySelector('[role="form"]'); |
44 | | - if (sendBox) { |
| 42 | + const sendBox = pageElements.byTestId(WebChat.testIds.sendBoxContainer); |
| 43 | + |
| 44 | + if (isFluentTheme) { |
45 | 45 | const dataTransfer = new DataTransfer(); |
46 | 46 | const file = new File(['dummy content'], 'test.txt', { type: 'text/plain' }); |
47 | 47 | dataTransfer.items.add(file); |
|
74 | 74 | // Attachment bar item should not appear |
75 | 75 | expect(pageElements.byTestId(WebChat.testIds.sendBoxAttachmentBarItem)).toBeFalsy(); |
76 | 76 |
|
77 | | - await host.snapshot('drag-and-drop-disabled'); |
| 77 | + await host.snapshot('local'); |
78 | 78 | } |
79 | 79 |
|
80 | 80 | // Hover interaction: hover over the send box area |
81 | | - await host.hover(document.querySelector('[role="form"]')); |
82 | | - await host.snapshot('hover-over-sendbox-toolbar'); |
| 81 | + await host.hover(pageElements.byTestId(WebChat.testIds.sendBoxContainer)); |
| 82 | + await host.snapshot('local'); |
83 | 83 |
|
84 | 84 | // Final visual confirmation |
85 | 85 | await host.snapshot('local'); |
|
0 commit comments