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

@@ -1,13 +1,13 @@
/* eslint-disable no-undef */
import { BaseItemCounts } from '../lib/Applications.js'
import * as Factory from '../lib/factory.js'
import { createItemParams, createSyncedNoteWithTag } from '../lib/Items.js'
import { createSyncedNoteWithTag } from '../lib/Items.js'
import * as Utils from '../lib/Utils.js'
chai.use(chaiAsPromised)
const expect = chai.expect
describe('online conflict handling', function () {
this.timeout(Factory.TenSecondTimeout)
const BASE_ITEM_COUNT = 2 /** Default items key, user preferences */
const syncOptions = {
checkIntegrity: true,
@@ -16,7 +16,7 @@ describe('online conflict handling', function () {
beforeEach(async function () {
localStorage.clear()
this.expectedItemCount = BASE_ITEM_COUNT
this.expectedItemCount = BaseItemCounts.DefaultItems
this.context = await Factory.createAppContextWithFakeCrypto('AppA')
await this.context.launch()

View File

@@ -1,12 +1,11 @@
/* eslint-disable no-unused-expressions */
/* eslint-disable no-undef */
import { BaseItemCounts } from '../lib/Applications.js'
import * as Factory from '../lib/factory.js'
chai.use(chaiAsPromised)
const expect = chai.expect
describe('sync integrity', () => {
const BASE_ITEM_COUNT = 2 /** Default items key, user preferences */
before(function () {
localStorage.clear()
})
@@ -16,7 +15,7 @@ describe('sync integrity', () => {
})
beforeEach(async function () {
this.expectedItemCount = BASE_ITEM_COUNT
this.expectedItemCount = BaseItemCounts.DefaultItems
this.application = await Factory.createInitAppWithFakeCrypto()
this.email = UuidGenerator.GenerateUuid()
this.password = UuidGenerator.GenerateUuid()

View File

@@ -1,19 +1,18 @@
/* eslint-disable no-unused-expressions */
/* eslint-disable no-undef */
import { BaseItemCounts } from '../lib/Applications.js'
import * as Factory from '../lib/factory.js'
chai.use(chaiAsPromised)
const expect = chai.expect
describe('offline syncing', () => {
const BASE_ITEM_COUNT = 2 /** Default items key, user preferences */
const syncOptions = {
checkIntegrity: true,
awaitAll: true,
}
beforeEach(async function () {
this.expectedItemCount = BASE_ITEM_COUNT
this.expectedItemCount = BaseItemCounts.DefaultItems
this.application = await Factory.createInitAppWithFakeCrypto()
})

View File

@@ -1,4 +1,5 @@
/* eslint-disable no-undef */
import { BaseItemCounts } from '../lib/Applications.js'
import * as Factory from '../lib/factory.js'
import * as Utils from '../lib/Utils.js'
chai.use(chaiAsPromised)
@@ -6,7 +7,6 @@ const expect = chai.expect
describe('online syncing', function () {
this.timeout(Factory.TenSecondTimeout)
const BASE_ITEM_COUNT = 2 /** Default items key, user preferences */
const syncOptions = {
checkIntegrity: true,
@@ -15,7 +15,7 @@ describe('online syncing', function () {
beforeEach(async function () {
localStorage.clear()
this.expectedItemCount = BASE_ITEM_COUNT
this.expectedItemCount = BaseItemCounts.DefaultItems
this.context = await Factory.createAppContext()
await this.context.launch()
@@ -97,7 +97,7 @@ describe('online syncing', function () {
this.application = await Factory.signOutApplicationAndReturnNew(this.application)
expect(this.application.itemManager.items.length).to.equal(BASE_ITEM_COUNT)
expect(this.application.itemManager.items.length).to.equal(BaseItemCounts.DefaultItems)
const promise = Factory.loginToApplication({
application: this.application,
@@ -244,7 +244,7 @@ describe('online syncing', function () {
// set item to be merged for when sign in occurs
await this.application.syncService.markAllItemsAsNeedingSyncAndPersist()
expect(this.application.syncService.isOutOfSync()).to.equal(false)
expect(this.application.itemManager.getDirtyItems().length).to.equal(BASE_ITEM_COUNT + 1)
expect(this.application.itemManager.getDirtyItems().length).to.equal(BaseItemCounts.DefaultItems + 1)
// Sign back in for next tests
await Factory.loginToApplication({
@@ -686,7 +686,7 @@ describe('online syncing', function () {
this.application = await Factory.signOutApplicationAndReturnNew(this.application)
const rawPayloads = await this.application.diskStorageService.getAllRawPayloads()
expect(rawPayloads.length).to.equal(BASE_ITEM_COUNT)
expect(rawPayloads.length).to.equal(BaseItemCounts.DefaultItems)
await this.application.signIn(this.email, this.password, undefined, undefined, undefined, true)