summaryrefslogtreecommitdiff
path: root/web/src/actions/build.test.js
diff options
context:
space:
mode:
authorTristan Cacqueray <tdecacqu@redhat.com>2019-08-15 20:55:40 +0000
committerTobias Henkel <tobias.henkel@bmw.de>2019-08-27 20:34:45 +0000
commitf9fe0adfdb9a751cf0748475930802e7f4d9d5b9 (patch)
tree79eec1e4dff64730026be15bb35206419ee52374 /web/src/actions/build.test.js
parent0811c5025e8c255dff5d208da6c74edcfe9c6acd (diff)
downloadzuul-f9fe0adfdb9a751cf0748475930802e7f4d9d5b9.tar.gz
web: test trailing slash are removed from renderTree
This change refactors the renderTree method to test it without React. Change-Id: Id1fcce671a5f8c44057a135a406298048a53bdb3
Diffstat (limited to 'web/src/actions/build.test.js')
-rw-r--r--web/src/actions/build.test.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/web/src/actions/build.test.js b/web/src/actions/build.test.js
index 64ee81d98..a80aa5d0b 100644
--- a/web/src/actions/build.test.js
+++ b/web/src/actions/build.test.js
@@ -24,4 +24,13 @@ it('processes job-output properly', () => {
expect(buildAction.hasInterestingKeys({rc: 42}, ['rc'])).toEqual(true)
expect(buildAction.hasInterestingKeys({noop: 42}, ['rc'])).toEqual(false)
+
+ // Check trailing / are removed
+ let obj = {children: [], mimetype: 'test', name: 'test'}
+ let tree = buildAction.renderTree(
+ {linkPrefix: 'test/'},
+ {log_url: 'http://test/', uuid: 'test'},
+ '/', obj, (a) => (a), (a) => (a))
+ expect(tree).toEqual(
+ {'icon': 'fa fa-file-o', 'nodes': [], 'text': 'http://test'})
})