From ac7fd9ae7a38d6ec95272f1605ced05ca3752171 Mon Sep 17 00:00:00 2001 From: David Evans Date: Sun, 21 Jan 2018 01:01:48 +0000 Subject: [PATCH] More testing of CodeMirror autocomplete --- scripts/sequence/CodeMirrorMode_spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/sequence/CodeMirrorMode_spec.js b/scripts/sequence/CodeMirrorMode_spec.js index 5fcab0a..bf000e2 100644 --- a/scripts/sequence/CodeMirrorMode_spec.js +++ b/scripts/sequence/CodeMirrorMode_spec.js @@ -386,6 +386,13 @@ defineDescribe('Code Mirror Mode', [ expect(hints).toContain('simultaneously '); }); + it('ignores indentation', () => { + cm.getDoc().setValue(' '); + const hints = getHintTexts({line: 0, ch: 2}); + expect(hints).toContain('theme '); + expect(hints).toContain('title '); + }); + it('suggests known header types', () => { cm.getDoc().setValue('headers '); const hints = getHintTexts({line: 0, ch: 8}); @@ -493,6 +500,16 @@ defineDescribe('Code Mirror Mode', [ expect(hints).toContain('Foo Bar '); }); + it('suggests quoted agent names if a quote is typed', () => { + cm.getDoc().setValue('Zig Zag -> Meh\nFoo Bar -> "'); + const hints = getHintTexts({line: 1, ch: 12}); + expect(hints).toEqual([ + '"Zig Zag" ', + '"Meh" ', + '"Foo Bar" ', + ]); + }); + it('suggests filtered multi-word agents', () => { cm.getDoc().setValue('Zig Zag -> Meh\nFoo Bar -> Foo '); const hints = getHintTexts({line: 1, ch: 15});