fix(core): update
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
import * as letterxpress from '../ts/index.js';
|
||||
import * as tsclass from '@tsclass/tsclass';
|
||||
|
||||
import { Qenv } from '@pushrocks/qenv';
|
||||
import { Qenv } from '@push.rocks/qenv';
|
||||
let testQenv = new Qenv('./', './.nogit/');
|
||||
|
||||
let testAccount: letterxpress.LetterXpressAccount;
|
||||
@ -10,8 +10,8 @@ let testLetter: tsclass.business.ILetter;
|
||||
|
||||
tap.test('should create a valid account', async () => {
|
||||
testAccount = await letterxpress.LetterXpressAccount.createAndInit({
|
||||
apiKey: testQenv.getEnvVarOnDemand('API_TOKEN'),
|
||||
username: testQenv.getEnvVarOnDemand('API_USERNAME'),
|
||||
apiKey: await testQenv.getEnvVarOnDemand('API_TOKEN'),
|
||||
username: await testQenv.getEnvVarOnDemand('API_USERNAME'),
|
||||
});
|
||||
expect(testAccount).toBeInstanceOf(letterxpress.LetterXpressAccount);
|
||||
});
|
||||
@ -75,31 +75,36 @@ tap.test('should send an actual letter', async () => {
|
||||
vatId: 'DE293580420',
|
||||
},
|
||||
subject: 'General Terms - Update',
|
||||
text: [
|
||||
`
|
||||
To whome it may concern,
|
||||
|
||||
**this is a testmessage.** we write to inform you about a change in our General Terms.
|
||||
As of December 1st 2019 we will start storing IPs that connect to our app for a period of 3 month.
|
||||
|
||||
Regards
|
||||
Lossless GmbH - Legal Department
|
||||
|
||||
`,
|
||||
],
|
||||
content: {
|
||||
textData: [`
|
||||
To whome it may concern,
|
||||
|
||||
**this is a testmessage.** we write to inform you about a change in our General Terms.
|
||||
As of December 1st 2019 we will start storing IPs that connect to our app for a period of 3 month.
|
||||
|
||||
Regards
|
||||
Lossless GmbH - Legal Department
|
||||
|
||||
`],
|
||||
timesheetData: null,
|
||||
},
|
||||
date: Date.now(),
|
||||
language: 'DE',
|
||||
logoUrl: '',
|
||||
needsCoverSheet: true,
|
||||
objectActions: [],
|
||||
pdfAttachments: [],
|
||||
timesheetData: null,
|
||||
type: 'notice',
|
||||
versionInfo: {
|
||||
type: 'final',
|
||||
version: '1.0.0',
|
||||
}
|
||||
};
|
||||
await testAccount.sendLetter(testLetter);
|
||||
const result = await testAccount.sendLetter(testLetter);
|
||||
});
|
||||
|
||||
tap.test('should be able to delete the sending job', async (toolsArg) => {
|
||||
await toolsArg.delayFor(3000);
|
||||
await toolsArg.delayFor(30000);
|
||||
await testAccount.cancelLetter(testLetter);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user