mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
23 lines
611 B
JavaScript
23 lines
611 B
JavaScript
|
const { setupDatabaseAndSynchronizer, switchClient } = require('./testing/test-utils.js');
|
||
|
const BaseModel = require('./BaseModel').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);
|
||
|
}));
|
||
|
|
||
|
});
|