diff --git a/tests/designs/config.mjs b/tests/designs/config.mjs index 30d20210b30..abbb7460222 100644 --- a/tests/designs/config.mjs +++ b/tests/designs/config.mjs @@ -99,7 +99,7 @@ export const testPatternConfig = (Pattern) => { const draft = new Pattern({ measurements: requested, }).draft() - + console.log(draft.setStores[0].logs) const missWarnings = draft.setStores[0].logs.warn.filter((w, i, a) => { return w.match(/tried to access `measurements/) && a.indexOf(w) === i }) diff --git a/tests/designs/i18n.mjs b/tests/designs/i18n.mjs index e4bac16efd0..f3f285719ad 100644 --- a/tests/designs/i18n.mjs +++ b/tests/designs/i18n.mjs @@ -61,17 +61,26 @@ export const testPatternI18n = (Pattern, i18n) => { expect(typeof i18n.en.o[key].d).to.equal('string') expect(i18n.en.o[key].d.length).to.be.above(1) }) - if (key.slice(-3) === 'Yes') { - it(` - The Yes translation of boolean option o.${key} should have a corresponding No translation`, () => { - expect(typeof i18n.en.o[key.slice(0, -3) + 'No'].t).to.equal('string') - }) - } else if (key.slice(-2) === 'No') { - it(` - The No translation of boolean option o.${key} should have a corresponding Yes translation`, () => { - expect(typeof i18n.en.o[key.slice(0, -2) + 'Yes'].t).to.equal('string') - }) - } else { - it(` - The translation of o.${key} should correspond to a known option`, () => { - expect(options.includes(key)).to.equal(true) + if (key.split('.').length === 1) { + // Regular option + if (key.slice(-3) === 'Yes') { + it(` - The Yes translation of boolean option o.${key} should have a corresponding No translation`, () => { + expect(typeof i18n.en.o[key.slice(0, -3) + 'No'].t).to.equal('string') + }) + } else if (key.slice(-2) === 'No') { + it(` - The No translation of boolean option o.${key} should have a corresponding Yes translation`, () => { + expect(typeof i18n.en.o[key.slice(0, -2) + 'Yes'].t).to.equal('string') + }) + } else { + it(` - The translation of o.${key} should correspond to a known option`, () => { + expect(options.includes(key)).to.equal(true) + }) + } + } else if (key.split('.').length === 2) { + // Entry of a list option + const [option, entry] = key.split('.') + it(` - The translation of o.${option} list option should have a transaltion for the ${entry} entry`, () => { + expect(Pattern.patternConfig.options[option].list.includes(entry)).to.equal(true) }) } }