diff --git a/packages/design-system/src/css/_tokens.dark.scss b/packages/design-system/src/css/_tokens.dark.scss index 25ef7c010c..2f20b13f95 100644 --- a/packages/design-system/src/css/_tokens.dark.scss +++ b/packages/design-system/src/css/_tokens.dark.scss @@ -126,6 +126,8 @@ --color-code-gutterBackground: var(--prim-gray-670); --color-code-gutterForeground: var(--prim-gray-320); --color-code-tags-comment: var(--prim-gray-200); + --color-line-break: var(--prim-gray-420); + --color-code-line-break: var(--prim-color-secondary-tint-100); // Variables --color-variables-usage-font: var(--prim-color-alt-a-tint-300); diff --git a/packages/design-system/src/css/_tokens.scss b/packages/design-system/src/css/_tokens.scss index 11bff5141b..6a0293e609 100644 --- a/packages/design-system/src/css/_tokens.scss +++ b/packages/design-system/src/css/_tokens.scss @@ -163,6 +163,8 @@ --color-code-gutterBackground: var(--prim-gray-0); --color-code-gutterForeground: var(--prim-gray-320); --color-code-tags-comment: var(--prim-gray-420); + --color-line-break: var(--prim-gray-320); + --color-code-line-break: var(--prim-color-secondary-tint-200); // Variables --color-variables-usage-font: var(--color-success); diff --git a/packages/editor-ui/src/components/RunDataJson.vue b/packages/editor-ui/src/components/RunDataJson.vue index 2281cc64ba..7ffc626c5c 100644 --- a/packages/editor-ui/src/components/RunDataJson.vue +++ b/packages/editor-ui/src/components/RunDataJson.vue @@ -264,6 +264,7 @@ export default defineComponent({ diff --git a/packages/editor-ui/src/components/__tests__/TextWithHIghlights.test.ts b/packages/editor-ui/src/components/__tests__/TextWithHIghlights.test.ts index 555ae1dae8..bb98a7ff98 100644 --- a/packages/editor-ui/src/components/__tests__/TextWithHIghlights.test.ts +++ b/packages/editor-ui/src/components/__tests__/TextWithHIghlights.test.ts @@ -21,7 +21,9 @@ describe('TextWithHighlights', () => { }, }); - expect(wrapper.html()).toEqual('Test content'); + expect(wrapper.html()).toEqual( + 'Test content', + ); expect(wrapper.html()).not.toContain(''); }); @@ -32,18 +34,19 @@ describe('TextWithHighlights', () => { }, }); - expect(wrapper.html()).toEqual('1'); + expect(wrapper.html()).toEqual('1'); expect(wrapper.html()).not.toContain(''); }); - it('renders correctly objects when search is not set', () => { + it('renders correctly objects when search is not set', async () => { const wrapper = shallowMount(TextWithHighlights, { props: { content: { hello: 'world' }, }, }); - - expect(wrapper.html()).toEqual('{\n "hello": "world"\n}'); + expect(wrapper.html()).toEqual( + '{\n "hello": "world"\n}', + ); expect(wrapper.html()).not.toContain(''); }); @@ -55,7 +58,9 @@ describe('TextWithHighlights', () => { }, }); - expect(wrapper.html()).toEqual('{\n "hello": "world"\n}'); + expect(wrapper.html()).toEqual( + '{\n "hello": "world"\n}', + ); expect(wrapper.html()).not.toContain(''); }); @@ -100,4 +105,16 @@ describe('TextWithHighlights', () => { 'Test content ()^${}[] world', ); }); + + it('renders new lines in the content correctly', () => { + const wrapper = shallowMount(TextWithHighlights, { + props: { + content: 'Line 1\n Line 2\nLine 3', + }, + }); + + expect(wrapper.html()).toContain( + 'Line 1\\n Line 2\\nLine 3', + ); + }); }); diff --git a/packages/editor-ui/src/components/__tests__/__snapshots__/RunDataJson.test.ts.snap b/packages/editor-ui/src/components/__tests__/__snapshots__/RunDataJson.test.ts.snap index 0f8242eace..7c4494b119 100644 --- a/packages/editor-ui/src/components/__tests__/__snapshots__/RunDataJson.test.ts.snap +++ b/packages/editor-ui/src/components/__tests__/__snapshots__/RunDataJson.test.ts.snap @@ -86,14 +86,19 @@ exports[`RunDataJson.vue > renders json values properly 1`] = ` > - "list" + + + + "list" + + renders json values properly 1`] = ` > - 1 + + + + 1 + + @@ -185,14 +195,19 @@ exports[`RunDataJson.vue > renders json values properly 1`] = ` > - 2 + + + + 2 + + @@ -230,14 +245,19 @@ exports[`RunDataJson.vue > renders json values properly 1`] = ` > - 3 + + + + 3 + + @@ -299,14 +319,19 @@ exports[`RunDataJson.vue > renders json values properly 1`] = ` > - "record" + + + + "record" + + renders json values properly 1`] = ` > - "name" + + + + "name" + + renders json values properly 1`] = ` class="vjs-value vjs-value-string" > - - "Joe" + + + + + "Joe" + + @@ -435,14 +472,19 @@ exports[`RunDataJson.vue > renders json values properly 1`] = ` > - "myNumber" + + + + "myNumber" + + renders json values properly 1`] = ` class="vjs-value vjs-value-number" > - - 123 + + + + + 123 + + @@ -490,14 +539,19 @@ exports[`RunDataJson.vue > renders json values properly 1`] = ` > - "myStringNumber" + + + + "myStringNumber" + + renders json values properly 1`] = ` class="vjs-value vjs-value-string" > - - "456" + + + + + "456" + + @@ -545,14 +606,19 @@ exports[`RunDataJson.vue > renders json values properly 1`] = ` > - "myStringText" + + + + "myStringText" + + renders json values properly 1`] = ` class="vjs-value vjs-value-string" > - - "abc" + + + + + "abc" + + @@ -600,14 +673,19 @@ exports[`RunDataJson.vue > renders json values properly 1`] = ` > - "nil" + + + + "nil" + + renders json values properly 1`] = ` class="vjs-value vjs-value-null" > - - null + + + + + null + + @@ -655,14 +740,19 @@ exports[`RunDataJson.vue > renders json values properly 1`] = ` > - "d" + + + + "d" + + renders json values properly 1`] = ` class="vjs-value vjs-value-undefined" > - + + + diff --git a/packages/editor-ui/src/components/__tests__/__snapshots__/RunDataSchema.test.ts.snap b/packages/editor-ui/src/components/__tests__/__snapshots__/RunDataSchema.test.ts.snap index 60c00cceb7..244c3e4581 100644 --- a/packages/editor-ui/src/components/__tests__/__snapshots__/RunDataSchema.test.ts.snap +++ b/packages/editor-ui/src/components/__tests__/__snapshots__/RunDataSchema.test.ts.snap @@ -59,16 +59,26 @@ exports[`RunDataJsonSchema.vue > renders schema for data 1`] = ` - name + + + + name + + + + + John + + @@ -109,16 +119,26 @@ exports[`RunDataJsonSchema.vue > renders schema for data 1`] = ` - age + + + + age + + + + + 22 + + @@ -159,9 +179,14 @@ exports[`RunDataJsonSchema.vue > renders schema for data 1`] = ` - hobbies + + + + hobbies + + @@ -228,20 +253,37 @@ exports[`RunDataJsonSchema.vue > renders schema for data 1`] = ` fill="currentColor" /> - - hobbies + + + + + hobbies + + - [0] + + + + [0] + + + + + surfing + + @@ -280,20 +322,37 @@ exports[`RunDataJsonSchema.vue > renders schema for data 1`] = ` fill="currentColor" /> - - hobbies + + + + + hobbies + + - [1] + + + + [1] + + + + + traveling + + @@ -417,9 +476,14 @@ exports[`RunDataJsonSchema.vue > renders schema with spaces and dots 1`] = ` - hello world + + + + hello world + + @@ -486,13 +550,25 @@ exports[`RunDataJsonSchema.vue > renders schema with spaces and dots 1`] = ` fill="currentColor" /> - - hello world + + + + + hello world + + - [0] + + + + [0] + + @@ -561,9 +637,14 @@ exports[`RunDataJsonSchema.vue > renders schema with spaces and dots 1`] = ` - test + + + + test + + @@ -632,16 +713,26 @@ exports[`RunDataJsonSchema.vue > renders schema with spaces and dots 1`] = ` - more to think about + + + + more to think about + + + + + 1 + + @@ -685,16 +776,26 @@ exports[`RunDataJsonSchema.vue > renders schema with spaces and dots 1`] = ` - test.how + + + + test.how + + + + + ignore + +