From 583a0f2cf6beccd64af7141d5cf12954974967c2 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 2 Oct 2018 20:26:24 +0200 Subject: [PATCH] Make tests more readable --- .../__snapshots__/index.test.js.snap | 6 +++ src/reducers/utils/__tests__/index.test.js | 54 +++++++++++-------- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/reducers/utils/__tests__/__snapshots__/index.test.js.snap b/src/reducers/utils/__tests__/__snapshots__/index.test.js.snap index dc206e2a..0f2d33bf 100644 --- a/src/reducers/utils/__tests__/__snapshots__/index.test.js.snap +++ b/src/reducers/utils/__tests__/__snapshots__/index.test.js.snap @@ -39,3 +39,9 @@ exports[`reducers utils observeChanges shoul NOT be the same - returns true 8`] exports[`reducers utils observeChanges shoul NOT be the same - returns true 9`] = `true`; exports[`reducers utils observeChanges shoul NOT be the same - returns true 10`] = `true`; + +exports[`reducers utils observeChanges shoul NOT be the same - returns true 11`] = `true`; + +exports[`reducers utils observeChanges shoul NOT be the same - returns true 12`] = `true`; + +exports[`reducers utils observeChanges shoul NOT be the same - returns true 13`] = `true`; diff --git a/src/reducers/utils/__tests__/index.test.js b/src/reducers/utils/__tests__/index.test.js index d9d2f913..391ac767 100644 --- a/src/reducers/utils/__tests__/index.test.js +++ b/src/reducers/utils/__tests__/index.test.js @@ -25,24 +25,24 @@ describe('reducers utils', () => { current: 'a', }, { - pervious: { test: 1 }, - current: { test: 1 }, + pervious: { one: 1 }, + current: { one: 1 }, }, { - pervious: { test: { test: 1 } }, - current: { test: { test: 1 } }, + pervious: { one: { two: 1 } }, + current: { one: { two: 1 } }, }, { - pervious: { test: { test: [1, 2, 3] } }, - current: { test: { test: [1, 2, 3] } }, + pervious: { one: { two: [1, 2, 3] } }, + current: { one: { two: [1, 2, 3] } }, }, { - pervious: { test: { test: [1, { test: 1 }, 3] } }, - current: { test: { test: [1, { test: 1 }, 3] } }, + pervious: { one: { two: [1, { three: 1 }, 3] } }, + current: { one: { two: [1, { three: 1 }, 3] } }, }, { - pervious: { test: { test: [1, { test: 1 }, { test: 3, test1: { test: 3 } }] } }, - current: { test: { test: [1, { test: 1 }, { test: 3, test1: { test: 3 } }] } }, + pervious: { one: { two: [1, { three: 1 }, { four: 3, five: { six: 3 } }] } }, + current: { one: { two: [1, { three: 1 }, { four: 3, five: { six: 3 } }] } }, }, ]; @@ -57,9 +57,13 @@ describe('reducers utils', () => { const data = [ // example of different data (true) { - pervious: { test: 1 }, + pervious: { one: 1 }, current: {}, }, + { + pervious: { one: 1 }, + current: { one: 1, two: 2 }, + }, { pervious: [{}, {}], current: [], @@ -77,24 +81,32 @@ describe('reducers utils', () => { current: '1', }, { - pervious: { test: 1 }, - current: { test: 2 }, + pervious: { one: 1 }, + current: { one: 2 }, }, { - pervious: { test: { test: 1 } }, - current: { test: { test: 2 } }, + pervious: { one: { two: 1 } }, + current: { one: { two: 2 } }, }, { - pervious: { test: { test: [1, 2, 3] } }, - current: { test: { test: [1, 1, 3] } }, + pervious: { one: { two: 1 } }, + current: { one: { two: 2 } }, }, { - pervious: { test: { test: [1, { test: 1 }, 3] } }, - current: { test: { test: [1, { test: 2 }, 3] } }, + pervious: { one: { two: [1, 2, 3] } }, + current: { one: { two: [1, 1, 3] } }, }, { - pervious: { test: { test: [1, { test: 1 }, { test: 3, test1: { test: 3 } }] } }, - current: { test: { test: [1, { test: 1 }, { test: 3, test1: { test: 1 } }] } }, + pervious: { one: { two: [1, { three: 1 }, 3] } }, + current: { one: { two: [1, { three: 2 }, 3] } }, + }, + { + pervious: { one: { two: [1, { three: 1 }, { four: 3, five: { six: 3 } }] } }, + current: { one: { two: [1, { three: 1 }, { four: 3, five: { six: 1 } }] } }, + }, + { + pervious: { one: { two: [1, { three: 1 }, { four: 3, five: { sixxx: 3 } }] } }, + current: { one: { two: [1, { three: 1 }, { four: 3, five: { six: 1 } }] } }, }, ];