1
0
Fork 0

fix: Exclude non-garments from certain pattern tests

This commit is contained in:
joostdecock 2021-08-30 19:53:42 +02:00
parent ef3bd03e2c
commit 0ac3358350

View file

@ -1,3 +1,12 @@
const notGarments = [
'rendertest',
'tutorial',
'examples',
'legend',
]
const isGarment = design => (notGarments.indexOf(design) === -1) true : false
/*
* This runs unit tests for the pattern configuration
* It expects the following:
@ -30,6 +39,8 @@ const testPatternConfig = (design, pattern, expect, models, patterns) => {
}
})
}
// Config tests for garments only
if (isGarment(design)) {
it(` - 'type' should be 'pattern' or 'block'`, () => {
expect(['pattern', 'block'].indexOf(pattern.config.type)).to.not.equal(-1)
})
@ -67,7 +78,6 @@ const testPatternConfig = (design, pattern, expect, models, patterns) => {
}
}
if (['rendertest', 'tutorial', 'examples', 'legend'].indexOf(design) === -1) {
/*
* Ensure pattern is listed as being for breasts or not
*/