From 1e467ac6e189ee66ccaf7c2ff2a3d6a16459a86c Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 7 Mar 2024 01:08:04 +0200 Subject: [PATCH] update tests --- .../services/theme_data/theme_data3.spec.js | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/test/unit/specs/services/theme_data/theme_data3.spec.js b/test/unit/specs/services/theme_data/theme_data3.spec.js index 0d5870cc42..25a9dda4d1 100644 --- a/test/unit/specs/services/theme_data/theme_data3.spec.js +++ b/test/unit/specs/services/theme_data/theme_data3.spec.js @@ -1,11 +1,13 @@ // import { topoSort } from 'src/services/theme_data/theme_data.service.js' import { - getAllPossibleCombinations, + getAllPossibleCombinations +} from 'src/services/theme_data/iss_utils.js' +import { init } from 'src/services/theme_data/theme_data_3.service.js' import { - sampleRules -} from 'src/services/theme_data/pleromafe.t3.js' + basePaletteKeys +} from 'src/services/theme_data/theme2_to_theme3.js' describe.only('Theme Data 3', () => { describe('getAllPossibleCombinations', () => { @@ -16,10 +18,23 @@ describe.only('Theme Data 3', () => { }) describe('init', () => { - it('test simple case', () => { - const out = init(sampleRules, palette) - // console.log(JSON.stringify(out, null, 2)) - console.log('\n' + out.css.join('\n') + '\n') + it('Test initialization without anything', () => { + const out = init([], '#DEADAF') + + expect(out).to.have.property('eager') + expect(out).to.have.property('lazy') + expect(out).to.have.property('staticVars') + + expect(out.lazy).to.be.an('array') + expect(out.lazy).to.have.lengthOf.above(1) + expect(out.eager).to.be.an('array') + expect(out.eager).to.have.lengthOf.above(1) + expect(out.staticVars).to.be.an('object') + + // check backwards compat/generic stuff + basePaletteKeys.forEach(key => { + expect(out.staticVars).to.have.property(key) + }) }) }) })