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,12 +1,12 @@
/* eslint-disable camelcase */
/* 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('app models', () => {
const BASE_ITEM_COUNT = 2 /** Default items key, user preferences */
const sharedApplication = Factory.createApplicationWithFakeCrypto()
before(async function () {
@@ -20,7 +20,7 @@ describe('app models', () => {
})
beforeEach(async function () {
this.expectedItemCount = BASE_ITEM_COUNT
this.expectedItemCount = BaseItemCounts.DefaultItems
this.application = await Factory.createInitAppWithFakeCrypto()
})

View File

@@ -1,5 +1,6 @@
/* eslint-disable no-unused-expressions */
/* eslint-disable no-undef */
import { BaseItemCounts } from '../lib/Applications.js'
import * as Factory from '../lib/factory.js'
import { createRelatedNoteTagPairPayload } from '../lib/Items.js'
chai.use(chaiAsPromised)
@@ -7,7 +8,6 @@ const expect = chai.expect
describe('importing', function () {
this.timeout(Factory.TenSecondTimeout)
const BASE_ITEM_COUNT = 2 /** Default items key, user preferences */
let expectedItemCount
let application
@@ -19,7 +19,7 @@ describe('importing', function () {
})
const setup = async ({ fakeCrypto }) => {
expectedItemCount = BASE_ITEM_COUNT
expectedItemCount = BaseItemCounts.DefaultItems
if (fakeCrypto) {
application = await Factory.createInitAppWithFakeCrypto()
} else {
@@ -599,12 +599,11 @@ describe('importing', function () {
application = await Factory.createInitAppWithFakeCrypto()
application.setLaunchCallback({
receiveChallenge: (challenge) => {
const values = challenge.prompts.map(
(prompt) =>
CreateChallengeValue(
prompt,
prompt.validation === ChallengeValidation.None ? 'incorrect password' : password,
),
const values = challenge.prompts.map((prompt) =>
CreateChallengeValue(
prompt,
prompt.validation === ChallengeValidation.None ? 'incorrect password' : password,
),
)
application.submitValuesForChallenge(challenge, values)
},
@@ -782,14 +781,13 @@ describe('importing', function () {
if (challenge.prompts.length === 2) {
application.submitValuesForChallenge(
challenge,
challenge.prompts.map(
(prompt) =>
CreateChallengeValue(
prompt,
prompt.validation !== ChallengeValidation.ProtectionSessionDuration
? password
: UnprotectedAccessSecondsDuration.OneMinute,
),
challenge.prompts.map((prompt) =>
CreateChallengeValue(
prompt,
prompt.validation !== ChallengeValidation.ProtectionSessionDuration
? password
: UnprotectedAccessSecondsDuration.OneMinute,
),
),
)
} else {

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('items', () => {
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,15 +1,14 @@
/* eslint-disable no-unused-expressions */
/* eslint-disable no-undef */
import { BaseItemCounts } from '../lib/Applications.js'
import * as Factory from '../lib/factory.js'
import { createNoteParams } from '../lib/Items.js'
chai.use(chaiAsPromised)
const expect = chai.expect
describe('model manager mapping', () => {
const BASE_ITEM_COUNT = 2 /** Default items key, user preferences */
beforeEach(async function () {
this.expectedItemCount = BASE_ITEM_COUNT
this.expectedItemCount = BaseItemCounts.DefaultItems
this.application = await Factory.createInitAppWithFakeCrypto()
})

View File

@@ -2,19 +2,18 @@
import * as Factory from '../lib/factory.js'
import * as Utils from '../lib/Utils.js'
import { createRelatedNoteTagPairPayload } from '../lib/Items.js'
import { BaseItemCounts } from '../lib/Applications.js'
chai.use(chaiAsPromised)
const expect = chai.expect
describe('notes and tags', () => {
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()
})