mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 13:27:38 +00:00
f87053cb02
feat: add browser opening to test:notification feat: add c8 and mocha for testing feat: update Docker and ci style: update editorconfig
39 lines
717 B
TypeScript
39 lines
717 B
TypeScript
import {Link, Store} from '../../src/store/model';
|
|
import open from 'open';
|
|
import {sendNotification} from '../../src/notification';
|
|
import {config} from '../../src/config';
|
|
|
|
const link: Link = {
|
|
brand: 'test:brand',
|
|
cartUrl: 'https://www.example.com/cartUrl',
|
|
model: 'test:model',
|
|
price: 100,
|
|
series: 'test:series',
|
|
url: 'https://www.example.com/url',
|
|
};
|
|
|
|
const store: Store = {
|
|
currency: '',
|
|
labels: {
|
|
inStock: {
|
|
container: 'test:container',
|
|
text: ['test:text'],
|
|
},
|
|
},
|
|
links: [link],
|
|
name: 'test:name',
|
|
};
|
|
|
|
/**
|
|
* Send test email.
|
|
*/
|
|
sendNotification(link, store);
|
|
|
|
/**
|
|
* Open browser.
|
|
*/
|
|
if (config.browser.open) {
|
|
open(link.cartUrl ?? link.url);
|
|
open(link.url);
|
|
}
|