aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webui/src/__tests__/query.ts31
1 files changed, 21 insertions, 10 deletions
diff --git a/webui/src/__tests__/query.ts b/webui/src/__tests__/query.ts
index f8ff6360..7abcecd2 100644
--- a/webui/src/__tests__/query.ts
+++ b/webui/src/__tests__/query.ts
@@ -11,16 +11,6 @@ it('parses a query with multiple filters', () => {
foo: ['bar'],
baz: ['foo-bar'],
});
-});
-
-it('parses a quoted query', () => {
- expect(parse(`foo:"bar"`)).toEqual({
- foo: [`"bar"`],
- });
-
- expect(parse(`foo:'bar'`)).toEqual({
- foo: [`'bar'`],
- });
expect(parse(`label:abc freetext`)).toEqual({
label: [`abc`],
@@ -35,6 +25,17 @@ it('parses a quoted query', () => {
freetext: [''],
});
+});
+
+it('parses a quoted query', () => {
+ expect(parse(`foo:"bar"`)).toEqual({
+ foo: [`"bar"`],
+ });
+
+ expect(parse(`foo:'bar'`)).toEqual({
+ foo: [`'bar'`],
+ });
+
expect(parse(`label:'multi word label'`)).toEqual({
label: [`'multi word label'`],
});
@@ -51,6 +52,10 @@ it('parses a quoted query', () => {
label: [`"multi word label with 'nested' quotes"`],
});
+ expect(parse(`label:"with:quoated:colon"`)).toEqual({
+ label: [`"with:quoated:colon"`],
+ });
+
expect(parse(`foo:'escaped\\' quotes'`)).toEqual({
foo: [`'escaped\\' quotes'`],
});
@@ -70,6 +75,12 @@ it('parses a complex query', () => {
});
});
+it('parses a key:value:value query', () => {
+ expect(parse(`meta:github:"https://github.com/MichaelMure/git-bug"`)).toEqual({
+ meta: [`github:"https://github.com/MichaelMure/git-bug"`],
+ });
+});
+
it('quotes values', () => {
expect(quote(`foo`)).toEqual(`foo`);
expect(quote(`foo bar`)).toEqual(`"foo bar"`);