Skip to content

Commit ab4941e

Browse files
messageArea
1 parent 2fd1c60 commit ab4941e

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

__mocks__/rdflib.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ export function st() {
2626

2727
export function literal() {
2828
}
29+
export class Query {
30+
vars: any
31+
pat: any
32+
constructor () {
33+
this.vars = []
34+
this.pat = {
35+
add() {}
36+
}
37+
}
38+
}
39+
40+
export function variable () {
41+
}
42+
2943
export function graph() {
3044
return {
3145
any: () => {

test/unit/messageArea.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1+
import { JSDOM } from 'jsdom'
12
import MessageArea from '../../src/messageArea'
3+
import * as RdfLib from 'rdflib'
4+
25
jest.mock('rdflib')
36
jest.mock('solid-auth-client')
7+
const window = new JSDOM('<!DOCTYPE html><p>Hello world</p>').window
8+
const dom = window.document
49

510
describe('MessageArea', () => {
611
it('exists', () => {
712
expect(MessageArea).toBeInstanceOf(Function)
813
})
14+
it('runs', () => {
15+
;(global as any).$rdf = RdfLib
16+
expect(MessageArea(
17+
dom,
18+
RdfLib.graph(),
19+
RdfLib.sym(''),
20+
RdfLib.sym(''),
21+
{}
22+
)).toBeTruthy()
23+
})
924
})

0 commit comments

Comments
 (0)