update tests

This commit is contained in:
Henry Jameson 2024-03-07 01:08:04 +02:00
parent afc94c6801
commit 1e467ac6e1

View File

@ -1,11 +1,13 @@
// import { topoSort } from 'src/services/theme_data/theme_data.service.js' // import { topoSort } from 'src/services/theme_data/theme_data.service.js'
import { import {
getAllPossibleCombinations, getAllPossibleCombinations
} from 'src/services/theme_data/iss_utils.js'
import {
init init
} from 'src/services/theme_data/theme_data_3.service.js' } from 'src/services/theme_data/theme_data_3.service.js'
import { import {
sampleRules basePaletteKeys
} from 'src/services/theme_data/pleromafe.t3.js' } from 'src/services/theme_data/theme2_to_theme3.js'
describe.only('Theme Data 3', () => { describe.only('Theme Data 3', () => {
describe('getAllPossibleCombinations', () => { describe('getAllPossibleCombinations', () => {
@ -16,10 +18,23 @@ describe.only('Theme Data 3', () => {
}) })
describe('init', () => { describe('init', () => {
it('test simple case', () => { it('Test initialization without anything', () => {
const out = init(sampleRules, palette) const out = init([], '#DEADAF')
// console.log(JSON.stringify(out, null, 2))
console.log('\n' + out.css.join('\n') + '\n') 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)
})
}) })
}) })
}) })