@dfosco/storyboard-core 1.15.2 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/viewfinder.js +1 -1
- package/src/viewfinder.test.js +5 -0
package/package.json
CHANGED
package/src/viewfinder.js
CHANGED
|
@@ -53,7 +53,7 @@ export function resolveSceneRoute(sceneName, knownRoutes = []) {
|
|
|
53
53
|
* Get sceneMeta for a scene (route, author, etc).
|
|
54
54
|
*
|
|
55
55
|
* @param {string} sceneName
|
|
56
|
-
* @returns {{ route?: string, author?: string } | null}
|
|
56
|
+
* @returns {{ route?: string, author?: string | string[] } | null}
|
|
57
57
|
*/
|
|
58
58
|
export function getSceneMeta(sceneName) {
|
|
59
59
|
try {
|
package/src/viewfinder.test.js
CHANGED
|
@@ -10,6 +10,7 @@ const makeIndex = () => ({
|
|
|
10
10
|
'no-route': { title: 'No route key' },
|
|
11
11
|
'meta-route': { sceneMeta: { route: 'Repositories' }, title: 'Meta Route' },
|
|
12
12
|
'meta-author': { sceneMeta: { author: 'dfosco' }, title: 'With Author' },
|
|
13
|
+
'meta-authors': { sceneMeta: { author: ['dfosco', 'heyamie', 'branonconor'] }, title: 'Multi Author' },
|
|
13
14
|
'meta-both': { sceneMeta: { route: '/Overview', author: 'octocat' }, title: 'Both' },
|
|
14
15
|
},
|
|
15
16
|
objects: {},
|
|
@@ -115,6 +116,10 @@ describe('getSceneMeta', () => {
|
|
|
115
116
|
expect(getSceneMeta('meta-both')).toEqual({ route: '/Overview', author: 'octocat' })
|
|
116
117
|
})
|
|
117
118
|
|
|
119
|
+
it('returns sceneMeta with array author', () => {
|
|
120
|
+
expect(getSceneMeta('meta-authors')).toEqual({ author: ['dfosco', 'heyamie', 'branonconor'] })
|
|
121
|
+
})
|
|
122
|
+
|
|
118
123
|
it('returns null when no sceneMeta', () => {
|
|
119
124
|
expect(getSceneMeta('default')).toBeNull()
|
|
120
125
|
})
|