Skip to content

Commit 9762a2b

Browse files
committed
Adding tests for copy expression
1 parent 53c893c commit 9762a2b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/views/live-watch/live-watch.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ describe('LiveWatchTreeDataProvider', () => {
192192
await (liveWatchTreeDataProvider as any).rename(node, 'node-1-renamed');
193193
expect(node.expression).toBe('node-1-renamed');
194194
});
195+
196+
it('copy copies node expression to clipboard', async () => {
197+
const node = makeNode('node-to-copy', { result: '1', variablesReference: 0 }, 1);
198+
(liveWatchTreeDataProvider as any).roots = [node];
199+
await (liveWatchTreeDataProvider as any).registerCopyCommand(node);
200+
expect(vscode.env.clipboard.writeText).toHaveBeenCalledWith('node-to-copy');
201+
});
195202
});
196203

197204
describe('refresh', () => {
@@ -247,7 +254,8 @@ describe('LiveWatchTreeDataProvider', () => {
247254
'vscode-cmsis-debugger.liveWatch.deleteAll',
248255
'vscode-cmsis-debugger.liveWatch.delete',
249256
'vscode-cmsis-debugger.liveWatch.refresh',
250-
'vscode-cmsis-debugger.liveWatch.modify'
257+
'vscode-cmsis-debugger.liveWatch.modify',
258+
'vscode-cmsis-debugger.liveWatch.copy'
251259
]));
252260
});
253261

0 commit comments

Comments
 (0)