🎨 add tests & refactor

- add test for getting all tags
- add test for transforming resources
- output.json -> mockOutput.json
This commit is contained in:
Kevin Van Der Werff
2019-10-22 15:28:11 +02:00
committed by Unknown
parent 330612ea4c
commit 8273955316
4 changed files with 29 additions and 14 deletions

View File

@@ -7,18 +7,13 @@ import {
partiallyIncludesElOf,
tagsNotEmpty,
cleanString,
addCleanTitleAndPath,
transformToResources,
} from '../utils/pure'
export const state = () => {
const resourcesLens = R.lens(R.prop('resources'), R.assoc('resources'))
return {
resources: R.map(category =>
R.over(resourcesLens, R.map(addCleanTitleAndPath(category.slug)), category),
categories),
tags: getAllTags(categories),
}
}
export const state = () => ({
resources: transformToResources(categories),
tags: getAllTags(categories),
})
export const getters = {
tags: R.prop('tags'),