forked from SolidOS/solid-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreferences.test.ts
More file actions
77 lines (69 loc) · 2.1 KB
/
preferences.test.ts
File metadata and controls
77 lines (69 loc) · 2.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import { silenceDebugMessages } from './helpers/debugger'
import { JSDOM } from 'jsdom'
import * as Preferences from '../../src/preferences'
import { sym } from 'rdflib'
silenceDebugMessages()
const window = new JSDOM('<!DOCTYPE html><p>Hello world</p>').window
const dom = window.document
describe('Preferences', () => {
it.skip('exists', () => {
expect(Preferences).toBeInstanceOf(Function)
})
})
describe('Preferences.value', () => {
it('exists', () => {
expect(Preferences.value).toEqual([])
})
})
describe('Preferences.get', () => {
it('exists', () => {
expect(Preferences.get).toBeInstanceOf(Function)
})
it('runs', () => {
expect(Preferences.get(10)).toEqual(undefined)
})
})
describe('Preferences.set', () => {
it('exists', () => {
expect(Preferences.set).toBeInstanceOf(Function)
})
it('runs', () => {
expect(Preferences.set(10, 'a')).toEqual(undefined)
})
})
describe('Preferences.renderPreferencesForm', () => {
it('exists', () => {
expect(Preferences.renderPreferencesForm).toBeInstanceOf(Function)
})
it('runs', () => {
const subject = sym('https://test.test')
const theClass = {}
const preferencesForm = {}
const context = { dom }
expect(Preferences.renderPreferencesForm(
subject, theClass, preferencesForm, context
)).toBeTruthy()
})
})
describe('Preferences.recordSharedPreferences', () => {
it('exists', () => {
expect(Preferences.recordSharedPreferences).toBeInstanceOf(Function)
})
it('runs', () => {
const subject = sym('https://test.test/sub')
const context = {}
expect(Preferences.recordSharedPreferences(subject, context)).toBeTruthy()
})
})
describe('Preferences.getPreferencesForClass', () => {
it('exists', () => {
expect(Preferences.getPreferencesForClass).toBeInstanceOf(Function)
})
it('runs', () => {
const subject = sym('https://test.test/sub')
const theClass = sym('https://test.test/class')
const predicates = [sym('https://test.test/pred')]
const context = {}
expect(Preferences.getPreferencesForClass(subject, theClass, predicates, context)).toBeTruthy()
})
})