forked from SolidOS/solid-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccess-controller.test.ts
More file actions
91 lines (81 loc) · 2.39 KB
/
Copy pathaccess-controller.test.ts
File metadata and controls
91 lines (81 loc) · 2.39 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
78
79
80
81
82
83
84
85
86
87
88
89
90
jest.mock('rdflib')
import * as RdfLib from 'rdflib'
jest.mock('solid-auth-client')
import * as SolidAuthClient from 'solid-auth-client'
import { element, dom } from '../../helpers/dom'
import { AccessController } from '../../../src/acl/access-controller'
import { DataBrowserContext } from 'pane-registry'
function instantiateAccessController() {
const subject = RdfLib.sym('')
const noun = ''
const context = {} as DataBrowserContext
const statusElement = element as unknown as HTMLElement
const classes = {}
const targetIsProtected = false
const targetDoc = RdfLib.sym('')
const targetACLDoc = RdfLib.sym('')
const defaultHolder = RdfLib.sym('')
const defaultACLDoc = RdfLib.sym('')
const prospectiveDefaultHolder = RdfLib.sym('')
const store = {}
return new AccessController(
subject,
noun,
context,
statusElement,
classes,
targetIsProtected,
targetDoc,
targetACLDoc,
defaultHolder,
defaultACLDoc,
prospectiveDefaultHolder,
store,
dom
)
}
describe('AccessController', () => {
it('exists', () => {
expect(AccessController).toBeTruthy()
})
it('runs', () => {
expect(instantiateAccessController()).toBeInstanceOf(AccessController)
})
})
describe('AccessController#isEditable', () => {
it('exists', () => {
expect(instantiateAccessController().isEditable).toEqual(false)
})
})
describe('AccessController#render', () => {
it('exists', () => {
expect(instantiateAccessController().render).toBeInstanceOf(Function)
})
it('runs', () => {
expect(instantiateAccessController().render()).toEqual(element)
})
})
describe('AccessController#renderTemporaryStatus', () => {
it('exists', () => {
expect(instantiateAccessController().renderTemporaryStatus).toBeInstanceOf(Function)
})
it('runs', () => {
expect(instantiateAccessController().renderTemporaryStatus('')).toEqual(undefined)
})
})
describe('AccessController#renderStatus', () => {
it('exists', () => {
expect(instantiateAccessController().renderStatus).toBeInstanceOf(Function)
})
it('runs', () => {
expect(instantiateAccessController().renderStatus('')).toEqual(undefined)
})
})
describe('AccessController#save', () => {
it('exists', () => {
expect(instantiateAccessController().save).toBeInstanceOf(Function)
})
it('runs', async () => {
expect(instantiateAccessController().save()).resolves.toEqual(undefined)
})
})