fix(structure): Unify structure even further

This commit is contained in:
2025-05-27 18:00:14 +00:00
parent 243a45d24c
commit 2aeb52bf13
10 changed files with 231 additions and 115 deletions

View File

@ -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) => {