2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00
books/dummy/tests/testDummy.spec.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
823 B
TypeScript
Raw Normal View History

2022-05-10 09:26:17 +00:00
import { assertDoesNotThrow } from 'backend/database/tests/helpers';
import { purchaseItemPartyMap } from 'dummy/helpers';
2022-10-31 07:33:50 +00:00
import test from 'tape';
import { getTestDbPath, getTestFyo } from 'tests/helpers';
2022-05-10 09:26:17 +00:00
import { setupDummyInstance } from '..';
2022-10-31 07:33:50 +00:00
const dbPath = getTestDbPath();
const fyo = getTestFyo();
2022-05-10 09:26:17 +00:00
2022-10-31 07:33:50 +00:00
test('setupDummyInstance', async () => {
await assertDoesNotThrow(async () => {
await setupDummyInstance(dbPath, fyo, 1, 25);
}, 'setup instance failed');
});
2022-05-10 09:26:17 +00:00
2022-10-31 07:33:50 +00:00
test('purchaseItemParty Existance', async (t) => {
for (const item in purchaseItemPartyMap) {
t.ok(await fyo.db.exists('Item', item), `item exists: ${item}`);
2022-10-31 07:33:50 +00:00
const party = purchaseItemPartyMap[item];
t.ok(await fyo.db.exists('Party', party), `party exists: ${party}`);
}
});
2022-10-31 07:33:50 +00:00
test.onFinish(async () => {
await fyo.close();
2022-05-10 09:26:17 +00:00
});