fix(structure): Unify structure even further
This commit is contained in:
@ -76,7 +76,7 @@ tap.test('TemplateManager - should register and retrieve templates', async (tool
|
||||
expect(templates.some(t => t.id === 'test-template')).toEqual(true);
|
||||
});
|
||||
|
||||
tap.test('TemplateManager - should create smartmail from template', async (tools) => {
|
||||
tap.test('TemplateManager - should create email from template', async (tools) => {
|
||||
const templateManager = new TemplateManager({
|
||||
from: 'test@example.com'
|
||||
});
|
||||
@ -93,15 +93,15 @@ tap.test('TemplateManager - should create smartmail from template', async (tools
|
||||
category: 'test'
|
||||
});
|
||||
|
||||
// Create smartmail from template
|
||||
const smartmail = await templateManager.createSmartmail('welcome-test', {
|
||||
// Create email from template
|
||||
const email = await templateManager.createEmail('welcome-test', {
|
||||
name: 'John Doe'
|
||||
});
|
||||
|
||||
expect(smartmail).toBeTruthy();
|
||||
expect(smartmail.options.from).toEqual('welcome@example.com');
|
||||
expect(smartmail.getSubject()).toEqual('Welcome, John Doe!');
|
||||
expect(smartmail.getBody(true).indexOf('Hello, John Doe!') > -1).toEqual(true);
|
||||
expect(email).toBeTruthy();
|
||||
expect(email.from).toEqual('welcome@example.com');
|
||||
expect(email.getSubjectWithVariables()).toEqual('Welcome, John Doe!');
|
||||
expect(email.getHtmlWithVariables()?.indexOf('Hello, John Doe!') > -1).toEqual(true);
|
||||
});
|
||||
|
||||
tap.test('Email - should handle template variables', async (tools) => {
|
||||
|
Reference in New Issue
Block a user