From 6a7d9d0fde3b0dc2f9bfea9549e3e79384b81fd1 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 9 Feb 2020 10:50:15 +0800 Subject: [PATCH] clean up --- .../assets/tests/scripts/notification.test.ts | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 resources/assets/tests/scripts/notification.test.ts diff --git a/resources/assets/tests/scripts/notification.test.ts b/resources/assets/tests/scripts/notification.test.ts deleted file mode 100644 index 7dfcc220..00000000 --- a/resources/assets/tests/scripts/notification.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { get } from '@/scripts/net' -import { showModal } from '@/scripts/notify' -import { flushPromises } from '../utils' -import handler from '@/scripts/notification' - -jest.mock('@/scripts/net') -jest.mock('@/scripts/notify') - -test('read notification', async () => { - document.body.innerHTML = ` -
- 2 - - -
- ` - document.querySelector('.notifications-list')!.addEventListener('click', handler) - get.mockResolvedValue({ - title: 'title', - content: 'content', - time: 'time', - }) - - document.querySelector('a')!.click() - await flushPromises() - expect(get).toBeCalledWith('/user/notifications/1') - expect(showModal).toBeCalledWith({ - mode: 'alert', - title: 'title', - dangerousHTML: 'content
time', - }) - expect(document.querySelectorAll('a')).toHaveLength(1) - expect(document.querySelector('span')!.textContent).toBe('1') - - document.querySelector('a')!.click() - await flushPromises() - expect(document.querySelector('span')).toBeNull() -})