|
|
@@ -13,7 +13,7 @@ describe('function notify', () => {
|
|
|
color: '#ad0000',
|
|
|
background: '#ffe1e1'
|
|
|
});
|
|
|
- let textNotify = document.querySelector('.nut-notify') as HTMLElement;
|
|
|
+ const textNotify = document.querySelector('.nut-notify') as HTMLElement;
|
|
|
expect(textNotify.innerHTML).toContain('基础用法');
|
|
|
expect(textNotify.style.color).toEqual('rgb(173, 0, 0)');
|
|
|
expect(textNotify.style.background).toEqual('rgb(255, 225, 225)');
|
|
|
@@ -24,7 +24,7 @@ describe('function notify', () => {
|
|
|
NotifyFunction.primary('主要通知', {
|
|
|
duration: 500
|
|
|
});
|
|
|
- let textNotify1 = document.querySelector('.nut-notify--primary') as HTMLElement;
|
|
|
+ const textNotify1 = document.querySelector('.nut-notify--primary') as HTMLElement;
|
|
|
expect(textNotify1.innerHTML).toContain('主要通知');
|
|
|
await sleep(500);
|
|
|
expect(textNotify1.style.display).toEqual('');
|
|
|
@@ -33,7 +33,7 @@ describe('function notify', () => {
|
|
|
NotifyFunction.success('成功通知', {
|
|
|
duration: 500
|
|
|
});
|
|
|
- let textNotify1 = document.querySelector('.nut-notify--success') as HTMLElement;
|
|
|
+ const textNotify1 = document.querySelector('.nut-notify--success') as HTMLElement;
|
|
|
expect(textNotify1.innerHTML).toContain('成功通知');
|
|
|
await sleep(500);
|
|
|
expect(textNotify1.style.display).toEqual('');
|
|
|
@@ -42,7 +42,7 @@ describe('function notify', () => {
|
|
|
NotifyFunction.danger('危险通知', {
|
|
|
duration: 500
|
|
|
});
|
|
|
- let textNotify1 = document.querySelector('.nut-notify--danger') as HTMLElement;
|
|
|
+ const textNotify1 = document.querySelector('.nut-notify--danger') as HTMLElement;
|
|
|
expect(textNotify1.innerHTML).toContain('危险通知');
|
|
|
await sleep(500);
|
|
|
expect(textNotify1.style.display).toEqual('');
|
|
|
@@ -51,7 +51,7 @@ describe('function notify', () => {
|
|
|
NotifyFunction.warn('警告通知', {
|
|
|
duration: 500
|
|
|
});
|
|
|
- let textNotify1 = document.querySelector('.nut-notify--warning') as HTMLElement;
|
|
|
+ const textNotify1 = document.querySelector('.nut-notify--warning') as HTMLElement;
|
|
|
expect(textNotify1.innerHTML).toContain('警告通知');
|
|
|
await sleep(500);
|
|
|
expect(textNotify1.style.display).toEqual('');
|