From c80b09499b16d3710a5559a8bd648c0b2efd76d0 Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Fri, 25 Oct 2024 11:05:14 +0200 Subject: [PATCH] refactor: tweaks --- dev-server/src/index.js | 20 +++++++------------ .../js/components/DataTypes/String-test.js | 10 ---------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/dev-server/src/index.js b/dev-server/src/index.js index a7bc62d..9158e1f 100644 --- a/dev-server/src/index.js +++ b/dev-server/src/index.js @@ -183,15 +183,9 @@ ReactDom.render( {/* String with special escape sequences */} { - console.log('edit callback', e) - if (e.new_value == 'error') { - return false - } - }} /> , document.getElementById('app-container') @@ -202,7 +196,7 @@ ReactDom.render( /*-------------------------------------------------------------------------*/ //just a function to get an example JSON object -function getExampleJson1() { +function getExampleJson1 () { return { string: 'this is a test string', integer: 42, @@ -231,7 +225,7 @@ function getExampleJson1() { } //and another a function to get an example JSON object -function getExampleJson2() { +function getExampleJson2 () { return { normalized: { '1-grams': { @@ -269,7 +263,7 @@ function getExampleJson2() { } } -function getExampleJson3() { +function getExampleJson3 () { return { example_information: 'this example has the collapsed prop set to true and the indentWidth prop is set to 8', @@ -285,7 +279,7 @@ function getExampleJson3() { } } -function getExampleJson4() { +function getExampleJson4 () { const large_array = new Array(225).fill('this is a large array full of items') large_array.push(getExampleArray()) @@ -295,7 +289,7 @@ function getExampleJson4() { return large_array } -function getExampleArray() { +function getExampleArray () { return [ 'you can also display arrays!', new Date(), @@ -308,6 +302,6 @@ function getExampleArray() { ] } -function getExampleWithStringEscapeSequences() { +function getExampleWithStringEscapeSequences () { return { '\\\n\t\r\f\\n': '\\\n\t\r\f\\n' } } diff --git a/test/tests/js/components/DataTypes/String-test.js b/test/tests/js/components/DataTypes/String-test.js index 41baea6..26e851d 100644 --- a/test/tests/js/components/DataTypes/String-test.js +++ b/test/tests/js/components/DataTypes/String-test.js @@ -6,11 +6,9 @@ import JsonString from './../../../../../src/js/components/DataTypes/String' describe('', function () { it('string component should have a data type label', function () { - const rjvId = 1 const wrapper = mount( @@ -19,10 +17,8 @@ describe('', function () { }) it('string with hidden data type', function () { - const rjvId = 1 const props = { value: 'test', - rjvId: 1, theme: 'rjv-default', displayDataTypes: false } @@ -32,10 +28,8 @@ describe('', function () { // test collapsed string and expand click it('string displaying data type', function () { - const rjvId = 1 const props = { value: 'test', - rjvId: 1, displayDataTypes: false, theme: 'rjv-default' } @@ -44,11 +38,9 @@ describe('', function () { }) it('collapsed string content', function () { - const rjvId = 1 const props = { value: '123456789', collapseStringsAfterLength: 3, - rjvId: 1, displayDataTypes: false, theme: 'rjv-default' } @@ -63,10 +55,8 @@ describe('', function () { }) it('string with special escape sequences', function () { - const rjvId = 1 const props = { value: '\\\n\t\r\f\\n', - rjvId: 1, displayDataTypes: false, theme: 'rjv-default' }