|
@@ -29,7 +29,6 @@ describe('parse SlashCommand', () => {
|
|
|
|
|
|
|
|
// when
|
|
// when
|
|
|
const result = parse(slashCommand);
|
|
const result = parse(slashCommand);
|
|
|
- console.log('32', result);
|
|
|
|
|
|
|
|
|
|
// then
|
|
// then
|
|
|
expect(result.text).toBe(slashCommandText);
|
|
expect(result.text).toBe(slashCommandText);
|
|
@@ -37,6 +36,34 @@ describe('parse SlashCommand', () => {
|
|
|
expect(result.growiCommandArgs).toStrictEqual([]);
|
|
expect(result.growiCommandArgs).toStrictEqual([]);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ test('returns a GrowiCommand instance with space growiCommandType', () => {
|
|
|
|
|
+ // setup
|
|
|
|
|
+ const slashCommandText = 'search ';
|
|
|
|
|
+ const slashCommand = new SlashCommandMock(slashCommandText);
|
|
|
|
|
+
|
|
|
|
|
+ // when
|
|
|
|
|
+ const result = parse(slashCommand);
|
|
|
|
|
+
|
|
|
|
|
+ // then
|
|
|
|
|
+ expect(result.text).toBe(slashCommandText);
|
|
|
|
|
+ expect(result.growiCommandType).toBe('search');
|
|
|
|
|
+ expect(result.growiCommandArgs).toStrictEqual([]);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ test('returns a GrowiCommand instance with space growiCommandArgs', () => {
|
|
|
|
|
+ // setup
|
|
|
|
|
+ const slashCommandText = 'search hoge ';
|
|
|
|
|
+ const slashCommand = new SlashCommandMock(slashCommandText);
|
|
|
|
|
+
|
|
|
|
|
+ // when
|
|
|
|
|
+ const result = parse(slashCommand);
|
|
|
|
|
+
|
|
|
|
|
+ // then
|
|
|
|
|
+ expect(result.text).toBe(slashCommandText);
|
|
|
|
|
+ expect(result.growiCommandType).toBe('search');
|
|
|
|
|
+ expect(result.growiCommandArgs).toStrictEqual(['hoge']);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
test('returns a GrowiCommand instance', () => {
|
|
test('returns a GrowiCommand instance', () => {
|
|
|
// setup
|
|
// setup
|
|
|
const slashCommandText = 'search keyword1 keyword2';
|
|
const slashCommandText = 'search keyword1 keyword2';
|