fix: dark mode not working in editors (#1773)

This commit is contained in:
Aman Harwara
2022-10-10 21:47:57 +05:30
committed by GitHub
parent dcb8024deb
commit 27d2c95b5b
30 changed files with 127 additions and 190 deletions

View File

@@ -83,11 +83,11 @@ describe('features', () => {
it('should fetch user features and create items for features with content type', async () => {
expect(application.apiService.getUserFeatures.callCount).to.equal(1)
expect(application.itemManager.createItem.callCount).to.equal(2)
const themeItems = application.items.getItems(ContentType.Theme)
const editorItems = application.items.getItems(ContentType.Component)
expect(themeItems).to.have.lengthOf(1)
expect(editorItems).to.have.lengthOf(1)
expect(themeItems[0].content).to.containSubset(
const systemThemeCount = 1
expect(themeItems).to.have.lengthOf(1 + systemThemeCount)
expect(themeItems[1].content).to.containSubset(
JSON.parse(
JSON.stringify({
name: midnightThemeFeature.name,
@@ -96,6 +96,9 @@ describe('features', () => {
}),
),
)
const editorItems = application.items.getItems(ContentType.Component)
expect(editorItems).to.have.lengthOf(1)
expect(editorItems[0].content).to.containSubset(
JSON.parse(
JSON.stringify({
@@ -157,7 +160,9 @@ describe('features', () => {
})
})
const themeItem = application.items.getItems(ContentType.Theme)[0]
const themeItem = application.items
.getItems(ContentType.Theme)
.find((theme) => theme.identifier === midnightThemeFeature.identifier)
// Wipe roles from initial sync
await application.featuresService.setRoles([])
@@ -171,7 +176,9 @@ describe('features', () => {
true,
)
const noTheme = application.items.getItems(ContentType.Theme)[0]
const noTheme = application.items
.getItems(ContentType.Theme)
.find((theme) => theme.identifier === midnightThemeFeature.identifier)
expect(noTheme).to.not.be.ok
})
})