From 5dd11ddcc591331232779c0a511b037e3a5b88d9 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 2 Feb 2021 18:01:41 +0000 Subject: [PATCH] Fixing issue with regex helper - escape test used the word 'test' a lot which breaks the helper. --- packages/string-templates/test/escapes.spec.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/string-templates/test/escapes.spec.js b/packages/string-templates/test/escapes.spec.js index de03c08fe6..21b1c4bcb0 100644 --- a/packages/string-templates/test/escapes.spec.js +++ b/packages/string-templates/test/escapes.spec.js @@ -4,15 +4,15 @@ const { describe("Handling context properties with spaces in their name", () => { it("should allow through literal specifiers", async () => { - const output = await processString("test {{ [test thing] }}", { - "test thing": 1 + const output = await processString("test {{ [one thing] }}", { + "one thing": 1 }) expect(output).toBe("test 1") }) it("should convert to dot notation where required", async () => { - const output = await processString("test {{ test[0] }}", { - test: [2] + const output = await processString("test {{ one[0] }}", { + one: [2] }) expect(output).toBe("test 2") }) @@ -25,9 +25,9 @@ describe("Handling context properties with spaces in their name", () => { }) it("should be able to handle an object with layers that requires escaping", async () => { - const output = await processString("testcase {{ testing.[test case] }}", { - testing: { - "test case": 1 + const output = await processString("testcase {{ thing.[one case] }}", { + thing: { + "one case": 1 } }) expect(output).toBe("testcase 1") @@ -52,10 +52,10 @@ describe("attempt some complex problems", () => { it("should be able to process an odd string produced by builder", async () => { const context = { "c306d140d7e854f388bae056db380a0eb": { - "test prop": "test", + "one prop": "test", } } - const hbs = "null{{ [c306d140d7e854f388bae056db380a0eb].[test prop] }}" + const hbs = "null{{ [c306d140d7e854f388bae056db380a0eb].[one prop] }}" const output = await processString(hbs, context) expect(output).toBe("nulltest") })