forked from SolidOS/solid-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessageTools.test.ts
More file actions
39 lines (33 loc) · 1 KB
/
messageTools.test.ts
File metadata and controls
39 lines (33 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { silenceDebugMessages } from '../helpers/debugger'
import {
sentimentStrip,
sentimentStripLinked,
messageToolbar
} from '../../../src/chat/messageTools'
import * as $rdf from 'rdflib'
const message1 = $rdf.sym('https://example.com/chat.ttl#message1')
silenceDebugMessages()
describe('sentimentStrip', () => {
it('exists', () => {
expect(sentimentStrip).toBeInstanceOf(Function)
})
it('runs', async () => {
expect(await sentimentStrip(message1)).toBeInstanceOf(Text)
})
})
describe('sentimentStripLinked', () => {
it('exists', () => {
expect(sentimentStripLinked).toBeInstanceOf(Function)
})
it('runs', async () => {
expect(await sentimentStripLinked(message1, message1.doc())).toBeInstanceOf(HTMLSpanElement)
})
})
describe('messageToolbar', () => {
it('exists', () => {
expect(messageToolbar).toBeInstanceOf(Function)
})
it('runs', async () => {
expect(await messageToolbar(message1, document.createElement('tr'), {})).toBeInstanceOf(HTMLDivElement)
})
})