mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 02:57:34 +00:00
refactor: use gts instead of xo
feat: add browser opening to test:notification feat: add c8 and mocha for testing feat: update Docker and ci style: update editorconfig
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user