Skip to content

Commit a8e346b

Browse files
more jest fixes
1 parent 24c5255 commit a8e346b

27 files changed

Lines changed: 19 additions & 84 deletions

test/unit/acl/acl-control.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { JSDOM } from 'jsdom'
2-
31
import {
42
ACLControlBox5,
53
preventBrowserDropEvents,
@@ -8,7 +6,6 @@ import {
86

97
jest.mock('rdflib')
108
jest.mock('solid-auth-client')
11-
const dom = new JSDOM('<!DOCTYPE html><p>Hello world</p>').window.document
129

1310
describe('ACLControlBox5', () => {
1411
it('exists', () => {

test/unit/acl/acl.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { JSDOM } from 'jsdom'
2-
31
import {
42
ACLbyCombination,
53
ACLToString,
@@ -24,7 +22,6 @@ import {
2422

2523
jest.mock('rdflib')
2624
jest.mock('solid-auth-client')
27-
const dom = new JSDOM('<!DOCTYPE html><p>Hello world</p>').window.document
2825

2926
describe('ACLbyCombination', () => {
3027
it('exists', () => {

test/unit/acl/index.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as Acl from '../../../src/acl/acl'
22
import * as AclControl from '../../../src/acl/acl-control'
33
import { acl, aclControl } from '../../../src/acl/index'
4-
import { JSDOM } from 'jsdom'
54

65
jest.mock('rdflib')
76
jest.mock('solid-auth-client')

test/unit/authn/index.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import * as Authn from '../../../src/authn/authn'
2-
import * as Index from '../../../src/authn/authn'
2+
import * as Index from '../../../src/authn/index'
33
jest.mock('rdflib')
44
jest.mock('solid-auth-client')
55

66
describe('authn/index', () => {
77
it('exports all of authn/authn', () => {
8-
for (const k in Authn) {
9-
if (k !== 'default') {
10-
expect(Index[k]).toEqual(Authn[k])
11-
}
12-
}
8+
expect(Object.keys(Authn).sort()).toEqual(Object.keys(Index.authn).sort())
139
})
1410
})

test/unit/chat/bookmarks.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('toggleBookmark', () => {
4040
const target = {}
4141
const bookmarkButton = {}
4242
try {
43-
const result = await toggleBookmark(userContext, target, bookmarkButton)
43+
await toggleBookmark(userContext, target, bookmarkButton)
4444
} catch (e) {
4545
expect(e.message).toEqual('Must be logged on to add Bookmark')
4646
}

test/unit/chat/dateFolder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as RdfLib from 'rdflib'
22

3-
import { default as DateFolder } from '../../../src/chat/dateFolder'
3+
import DateFolder from '../../../src/chat/dateFolder'
44
jest.mock('rdflib')
55
jest.mock('solid-auth-client')
66

test/unit/chat/infinite.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { infiniteMessageArea } from '../../../src/chat/infinite'
55
jest.mock('rdflib')
66
jest.mock('solid-auth-client')
77
const dom = new JSDOM('<!DOCTYPE html><p>Hello world</p>').window.document
8-
const element = dom.createElement('div')
98

109
describe('infiniteMessageArea', () => {
1110
it('exists', () => {
@@ -14,8 +13,10 @@ describe('infiniteMessageArea', () => {
1413
it('runs', () => {
1514
const kb = RdfLib.graph()
1615
const chatChannel = {
17-
dir: () => {
18-
uri: ''
16+
dir () {
17+
return {
18+
uri: ''
19+
}
1920
}
2021
}
2122
const options = {}

test/unit/chat/message.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { JSDOM } from 'jsdom'
2-
31
import {
42
elementForImageURI,
53
creatorAndDate,
@@ -8,7 +6,6 @@ import {
86
} from '../../../src/chat/message'
97
jest.mock('rdflib')
108
jest.mock('solid-auth-client')
11-
const dom = new JSDOM('<!DOCTYPE html><p>Hello world</p>').window.document
129

1310
describe('elementForImageURI', () => {
1411
it('exists', () => {

test/unit/chat/messageTools.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import { JSDOM } from 'jsdom'
2-
31
import {
42
sentimentStrip,
53
sentimentStripLinked,
64
messageToolbar
75
} from '../../../src/chat/messageTools'
86
jest.mock('rdflib')
97
jest.mock('solid-auth-client')
10-
const dom = new JSDOM('<!DOCTYPE html><p>Hello world</p>').window.document
118

129
describe('sentimentStrip', () => {
1310
it('exists', () => {

test/unit/chat/thread.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as RdfLib from 'rdflib'
22
import { JSDOM } from 'jsdom'
33

4-
import { default as thread } from '../../../src/chat/thread'
4+
import thread from '../../../src/chat/thread'
55
jest.mock('rdflib')
66
jest.mock('solid-auth-client')
77
const dom = new JSDOM('<!DOCTYPE html><p>Hello world</p>').window.document

0 commit comments

Comments
 (0)