Skip to content

Commit 9ad2fb5

Browse files
committed
Improve file selection handling by replacing targetElementId with requestId in SELECT_FILE messages
1 parent 62260d0 commit 9ad2fb5

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/views/manage-solution/manage-solution-webview-main.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ describe('ContextSelectionWebviewMain', () => {
568568
jest.spyOn(vscode.window, 'showOpenDialog').mockResolvedValue(undefined);
569569

570570
await fireAndWait('SELECT_FILE', {
571-
targetElementId: 'image-path',
571+
requestId: 'image-path',
572572
options: {
573573
canSelectMany: false,
574574
openLabel: 'Select File',
@@ -580,7 +580,13 @@ describe('ContextSelectionWebviewMain', () => {
580580
.map(([message]) => message)
581581
.filter(message => message.type === 'FILE_SELECTED');
582582

583-
expect(selectedMessages).toHaveLength(0);
583+
expect(selectedMessages).toEqual([
584+
expect.objectContaining({
585+
type: 'FILE_SELECTED',
586+
data: [],
587+
requestId: 'image-path'
588+
})
589+
]);
584590
});
585591

586592
it('sends all selected files when canSelectMany is true', async () => {
@@ -599,7 +605,7 @@ describe('ContextSelectionWebviewMain', () => {
599605
]);
600606

601607
await fireAndWait('SELECT_FILE', {
602-
targetElementId: 'image-path',
608+
requestId: 'image-path',
603609
options: {
604610
canSelectMany: true,
605611
openLabel: 'Select Files',

0 commit comments

Comments
 (0)