mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-12 08:54:00 +02:00
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
/* eslint-disable no-unused-vars */
|
|
|
|
|
|
const time = require('@joplin/lib/time').default;
|
|
const { sortedIds, createNTestNotes, fileContentEqual, setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient, syncTargetId, objectsEqual, checkThrowAsync } = require('./test-utils.js');
|
|
const Folder = require('@joplin/lib/models/Folder.js');
|
|
const Note = require('@joplin/lib/models/Note.js');
|
|
const Setting = require('@joplin/lib/models/Setting').default;
|
|
const BaseModel = require('@joplin/lib/BaseModel').default;
|
|
const ArrayUtils = require('@joplin/lib/ArrayUtils.js');
|
|
const shim = require('@joplin/lib/shim').default;
|
|
|
|
describe('database', function() {
|
|
beforeEach(async (done) => {
|
|
await setupDatabaseAndSynchronizer(1);
|
|
await switchClient(1);
|
|
done();
|
|
});
|
|
|
|
it('should not modify cached field names', (async () => {
|
|
const db = BaseModel.db();
|
|
|
|
const fieldNames = db.tableFieldNames('notes');
|
|
const fieldCount = fieldNames.length;
|
|
fieldNames.push('type_');
|
|
|
|
expect(fieldCount).toBeGreaterThan(0);
|
|
expect(db.tableFieldNames('notes').length).toBe(fieldCount);
|
|
}));
|
|
|
|
});
|