From 2e6fc53625eaaecbae1ca4581feb9b01cd69f5b6 Mon Sep 17 00:00:00 2001 From: Johan Hernefeldt Date: Sat, 10 Jun 2017 16:12:03 +0200 Subject: [PATCH] Full test coverage in helpers --- src/common/helpers.spec.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/helpers.spec.js b/src/common/helpers.spec.js index 89ab514..b3f491f 100644 --- a/src/common/helpers.spec.js +++ b/src/common/helpers.spec.js @@ -81,6 +81,10 @@ describe('helpers.getLocalPath', () => { expect(helpers.getLocalPath('$parent/count', subState)).toEqual('foo$bar/choo$test/count'); }); + it('replaces $root to root instance and $parent to parent instance', () => { + expect(helpers.getLocalPath('$root/$parent/count', subState)).toEqual('foo$bar/choo$test/count'); + }); + it('makes no changes when no keywords are used', () => { expect(helpers.getLocalPath('foo/bar/piri/choo', state)).toEqual('foo/bar/piri/choo'); });