1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-30 20:39:46 +02:00

Compare commits

...

9 Commits

Author SHA1 Message Date
Laurent Cozic
1c7b568b20 fixed test 2022-04-11 22:50:26 +01:00
Laurent Cozic
c3d892615d fixed test 2022-04-11 21:59:19 +01:00
Laurent Cozic
0c5d2b8120 Revert "fixed test"
This reverts commit 80a94f02b9.
2022-04-11 21:58:13 +01:00
Laurent Cozic
80a94f02b9 fixed test 2022-04-11 20:41:41 +01:00
Laurent Cozic
d3763345f0 fixed test 2022-04-11 20:03:14 +01:00
Laurent Cozic
9cf19f4b5c fixed test 2022-04-11 19:32:43 +01:00
Laurent Cozic
da2a61df0a fixed test 2022-04-11 19:27:56 +01:00
Laurent Cozic
da2a00bf1d fixed test 2022-04-11 18:08:40 +01:00
Laurent Cozic
37c712c778 trying to fix windows ci 2022-04-11 17:49:04 +01:00
6 changed files with 20 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ jobs:
strategy:
matrix:
# Removed windows-2016 for now - discontinued by GitHub
os: [macos-latest, ubuntu-latest]
os: [macos-latest, ubuntu-latest, windows-2019]
steps:
# Silence apt-get update errors (for example when a module doesn't

View File

@@ -1,5 +1,6 @@
import { notesSortOrderFieldArray, notesSortOrderNextField, setNotesSortOrder } from './notesSortOrderUtils';
import Setting from '@joplin/lib/models/Setting';
// import { setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/test-utils';
const { shimInit } = require('@joplin/lib/shim-init-node.js');
beforeAll(() => {
@@ -9,6 +10,12 @@ beforeAll(() => {
describe('notesSortOrderUtils', () => {
// beforeEach(async (done) => {
// await setupDatabaseAndSynchronizer(1);
// await switchClient(1);
// done();
// });
it('should always provide the same ordered fields', async () => {
const expected = ['user_updated_time', 'user_created_time', 'title', 'order'];
expect(notesSortOrderFieldArray()).toStrictEqual(expected);

View File

@@ -23,6 +23,11 @@ const switchToSubProfileSettings = async () => {
await Setting.load();
};
const restoreSettingState = async () => {
await setupDatabaseAndSynchronizer(1);
await switchClient(1);
};
describe('models/Setting', function() {
beforeEach(async (done) => {
@@ -291,6 +296,8 @@ describe('models/Setting', function() {
expect((await Setting.loadOne('locale')).value).toBe('fr_FR');
expect((await Setting.loadOne('theme')).value).toBe(Setting.THEME_DARK);
expect((await Setting.loadOne('sync.target')).value).toBe(undefined);
await restoreSettingState();
});
it('should save sub-profile settings', async () => {
@@ -327,6 +334,8 @@ describe('models/Setting', function() {
'$schema': 'https://joplinapp.org/schema/settings.json',
'sync.target': 8,
});
await restoreSettingState();
});
it('all global settings should be saved to file', async () => {

View File

@@ -1516,7 +1516,7 @@ class Setting extends BaseModel {
this.metadata_ = Object.assign(this.metadata_, this.customMetadata_);
if (this.value('env') === Env.Dev) this.validateMetadata(this.metadata_);
if (this.constants_.env === Env.Dev) this.validateMetadata(this.metadata_);
return this.metadata_;
}

View File

@@ -46,7 +46,6 @@ export default class InteropService_Importer_Md extends InteropService_Importer_
}
async importDirectory(dirPath: string, parentFolderId: string) {
console.info(`Import: ${dirPath}`);
const supportedFileExtension = this.metadata().fileExtensions;
const stats = await shim.fsDriver().readDirStats(dirPath);
for (let i = 0; i < stats.length; i++) {
@@ -54,7 +53,6 @@ export default class InteropService_Importer_Md extends InteropService_Importer_
if (stat.isDirectory()) {
if (await this.isDirectoryEmpty(`${dirPath}/${stat.path}`)) {
console.info(`Ignoring empty directory: ${stat.path}`);
continue;
}
const folderTitle = await Folder.findUniqueItemTitle(basename(stat.path));

View File

@@ -26,6 +26,7 @@ const input: Theme = {
selectedColor2: '#131313',
colorError2: '#ff6c6c',
colorWarn2: '#ffcb81',
colorWarn3: '#ff7626',
// Color scheme "3" is used for the config screens for example/
// It's dark text over gray background.
@@ -76,6 +77,7 @@ const expected = `
--joplin-selected-color2: #131313;
--joplin-color-error2: #ff6c6c;
--joplin-color-warn2: #ffcb81;
--joplin-color-warn3: #ff7626;
--joplin-background-color3: #F4F5F6;
--joplin-background-color-hover3: #CBDAF1;
--joplin-color3: #738598;