Skip to content

Commit

Permalink
Fix commented test case that might randomly fail (#902)
Browse files Browse the repository at this point in the history
  • Loading branch information
bentongxyz authored Jan 7, 2022
1 parent c8f1f8e commit 6956e07
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions packages/foam-vscode/src/features/copy-without-brackets.spec.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
// import { env, window, Uri, Position, Selection, commands } from 'vscode';
// import * as vscode from 'vscode';
import { env, Position, Selection, commands } from 'vscode';
import {
createFile,
getUriInWorkspace,
showInEditor,
} from '../test/test-utils-vscode';

describe('copyWithoutBrackets', () => {
it('should pass CI', () => {
expect(true).toBe(true);
it('should get the input from the active editor selection', async () => {
const { uri } = await createFile('This is my [[test-content]].');
const { editor } = await showInEditor(uri);
editor.selection = new Selection(new Position(0, 0), new Position(1, 0));
await commands.executeCommand('foam-vscode.copy-without-brackets');
const value = await env.clipboard.readText();
expect(value).toEqual('This is my Test Content.');
});
// it('should get the input from the active editor selection', async () => {
// const doc = await vscode.workspace.openTextDocument(
// Uri.parse('untitled:/hello.md')
// );
// const editor = await window.showTextDocument(doc);
// editor.edit(builder => {
// builder.insert(new Position(0, 0), 'This is my [[test-content]].');
// });
// editor.selection = new Selection(new Position(0, 0), new Position(1, 0));
// await commands.executeCommand('foam-vscode.copy-without-brackets');
// const value = await env.clipboard.readText();
// expect(value).toEqual('This is my Test Content.');
// });
});

0 comments on commit 6956e07

Please sign in to comment.