🎨 ✅ add tests & refactor
- add test for getting all tags - add test for transforming resources - output.json -> mockOutput.json
This commit is contained in:
committed by
Unknown
parent
330612ea4c
commit
8273955316
@@ -1,4 +1,6 @@
|
||||
import * as P from '../utils/pure.js'
|
||||
import mockCategories from './mockCategories.json'
|
||||
import mockOutput from './mockOutput.json'
|
||||
|
||||
test('includesElOf 1', () => {
|
||||
expect(P.includesElOf([1, 2])([2])).toBeTruthy
|
||||
@@ -27,3 +29,13 @@ test('partiallyIncludesElOf 2', () => {
|
||||
test('partiallyIncludesElOf 3', () => {
|
||||
expect(P.partiallyIncludesElOf(['aa', 'b'], ['c'])).toBeFalsy
|
||||
})
|
||||
|
||||
test('get all tags', () => {
|
||||
expect(P.getAllTags(mockCategories)).toStrictEqual([
|
||||
"generator", "grid", "layout", "visual tool", "animation", "educational", "beginner", "career", "ui", "ux", "illustration", "svg", "tips", "tricks",
|
||||
])
|
||||
})
|
||||
|
||||
test('transform resources', () => {
|
||||
expect(P.transformToResources(mockCategories)).toStrictEqual(mockOutput)
|
||||
})
|
||||
Reference in New Issue
Block a user