fix and improve tests

This commit is contained in:
Henry Jameson 2025-02-18 18:30:08 +02:00
parent f7f09f0dbc
commit 97c9b6e25d
2 changed files with 6 additions and 5 deletions

View file

@ -154,13 +154,13 @@ componentsContext.keys().forEach(key => {
}
components[component.name] = component
})
Object.keys(components).forEach(key => {
if (key === 'Root') return
components.Root.validInnerComponents = components.Root.validInnerComponents || []
components.Root.validInnerComponents.push(key)
})
Object.keys(components).forEach(key => {
const component = components[key]
const { validInnerComponents = [] } = component
@ -571,6 +571,7 @@ export const init = ({
}
if (
!liteMode &&
parent?.component !== 'Root' &&
!virtualComponents.has(component.name) &&
!transparentComponents.has(component.name) &&

View file

@ -1,4 +1,3 @@
// import { topoSort } from 'src/services/theme_data/theme_data.service.js'
import {
getAllPossibleCombinations
} from 'src/services/theme_data/iss_utils.js'
@ -120,6 +119,7 @@ describe('Theme Data 3', () => {
opacity: 0.5
}
}],
onlyNormalState: true,
ultimateBackgroundColor: '#DEADAF'
})
@ -142,9 +142,9 @@ describe('Theme Data 3', () => {
*/
expect(panelRule).to.have.nested.deep.property('dynamicVars.stacked.r').that.is.closeTo(88.8, 0.01)
expect(panelRule).to.have.nested.deep.property('dynamicVars.stacked.g').that.is.closeTo(133.2, 0.01)
expect(panelRule).to.have.nested.deep.property('dynamicVars.stacked.b').that.is.closeTo(134, 0.01)
expect(panelRule).to.have.nested.deep.property('dynamicVars.stacked.r').that.is.closeTo(111, 0.01)
expect(panelRule).to.have.nested.deep.property('dynamicVars.stacked.g').that.is.closeTo(150.5, 0.01)
expect(panelRule).to.have.nested.deep.property('dynamicVars.stacked.b').that.is.closeTo(151.5, 0.01)
})
})
})