remove old dirt
This commit is contained in:
parent
926dc3f3dd
commit
f00a3aa103
3 changed files with 61 additions and 8 deletions
|
|
@ -1,8 +0,0 @@
|
||||||
const { test, expect } = require('@playwright/test');
|
|
||||||
|
|
||||||
test('Home page has correct title', async ({ page }) => {
|
|
||||||
await page.goto('http://localhost/');
|
|
||||||
const title = await page.title();
|
|
||||||
|
|
||||||
expect(title).toBe('Hello World');
|
|
||||||
});
|
|
||||||
18
tests/createOffer.spec.js
Normal file
18
tests/createOffer.spec.js
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
const { test, expect } = require('./test-setup');
|
||||||
|
const SessionRelatedToPublickey = require('../src/models/SessionRelatedToPublickey');
|
||||||
|
const NymSet = require('../src/models/NymSet');
|
||||||
|
const ContactDetailsSet = require('../src/models/ContactDetailsSet');
|
||||||
|
|
||||||
|
test('Mock ecords are present', async ({ page }) => {
|
||||||
|
for (const someModel of [
|
||||||
|
SessionRelatedToPublickey,
|
||||||
|
NymSet,
|
||||||
|
ContactDetailsSet,
|
||||||
|
]) {
|
||||||
|
expect(await someModel.findOne()).toBeTruthy();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Check that UI controls are manageable with a few test cases.
|
||||||
|
|
||||||
|
// Check that the offer is created after submitting
|
||||||
43
tests/test-setup.js
Normal file
43
tests/test-setup.js
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
import { test } from '@playwright/test';
|
||||||
|
const SessionRelatedToPublickey = require('../src/models/SessionRelatedToPublickey');
|
||||||
|
const NymSet = require('../src/models/NymSet');
|
||||||
|
const ContactDetailsSet = require('../src/models/ContactDetailsSet');
|
||||||
|
|
||||||
|
test.beforeEach(async () => {
|
||||||
|
// Truncate all affected tables
|
||||||
|
|
||||||
|
for (const someModel of [
|
||||||
|
SessionRelatedToPublickey,
|
||||||
|
NymSet,
|
||||||
|
ContactDetailsSet,
|
||||||
|
]) {
|
||||||
|
someModel.truncate();
|
||||||
|
}
|
||||||
|
|
||||||
|
await SessionRelatedToPublickey.create({
|
||||||
|
uuid: '0195423b-f9ae-737e-98f3-880f6563ed8a',
|
||||||
|
session_uuid: '0195423c-33d7-75f8-921b-a06e6d3cb8c5',
|
||||||
|
public_key:
|
||||||
|
'd3d4c49e7bdbbbf3082151add080e92f9a458d5dec993b371fe6d02cd394d57a',
|
||||||
|
created_at: new Date().toISOString(),
|
||||||
|
});
|
||||||
|
|
||||||
|
await NymSet.create({
|
||||||
|
uuid: '01954240-ddbb-7d01-9017-efb3e500d333',
|
||||||
|
public_key:
|
||||||
|
'd3d4c49e7bdbbbf3082151add080e92f9a458d5dec993b371fe6d02cd394d57a',
|
||||||
|
nym: 'test_nym',
|
||||||
|
created_at: new Date().toISOString(),
|
||||||
|
});
|
||||||
|
|
||||||
|
await ContactDetailsSet.create({
|
||||||
|
uuid: '01954240-ddbb-7d01-9017-efb3e500d333',
|
||||||
|
public_key:
|
||||||
|
'd3d4c49e7bdbbbf3082151add080e92f9a458d5dec993b371fe6d02cd394d57a',
|
||||||
|
encrypted_contact_details:
|
||||||
|
'+OD0/Y2IkJ99/E0KAJL/mp3kxQo4DFp1deSPnqiejlyGoeWzBiipemPVSTT/Jg/fCQbN9Pd/GJ6shxuwWECOVyB5PnMZOVJ1MPQ7I8A+63XZ0gKnSnJgry6F69f3MhEjH49JbeVJ37TbruFu/Woevo24VWz2gPXGBuyHLzeg1tyT9+7ZSygkcCrh+bchvymCoF1nNOm/UQKnwecH1wWzo8a+rNokazD1/3iey6iKmKewi+yGCgmljrB866akqBAl?iv=PAKhqTeBfYVX/muhM8xaEA==',
|
||||||
|
created_at: new Date().toISOString(),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
export { test, expect } from '@playwright/test';
|
||||||
Loading…
Add table
Add a link
Reference in a new issue