From 8b1067d180b6bea7cb717d376f53d30b91a3fd61 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 1 Jun 2017 17:11:07 -0700 Subject: [PATCH] Remove no longer valid clipboard test and add new one --- src/handlers/Clipboard.test.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/handlers/Clipboard.test.ts b/src/handlers/Clipboard.test.ts index 471389c..59ac761 100644 --- a/src/handlers/Clipboard.test.ts +++ b/src/handlers/Clipboard.test.ts @@ -4,16 +4,10 @@ import * as Clipboard from './Clipboard'; describe('evaluateCopiedTextProcessing', function () { - it('should strip trailing whitespaces and replace nbsps with spaces', function () { - let nonBreakingSpace = String.fromCharCode(160), - copiedText = 'echo' + nonBreakingSpace + 'hello' + nonBreakingSpace, - processedText = Clipboard.prepareTextForClipboard(copiedText); - - // No trailing spaces - assert.equal(processedText.match(/\s+$/), null); - - // No non-breaking space - assert.equal(processedText.indexOf(nonBreakingSpace), -1); + it('should replace non-breaking spaces with regular spaces', () => { + const nbsp = String.fromCharCode(160); + const result = Clipboard.prepareTextForClipboard(`foo${nbsp}bar\ntest${nbsp}${nbsp}`); + assert.equal(result, 'foo bar\ntest '); }); });