forked from SolidOS/solid-panes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofilePane.test.ts
More file actions
28 lines (24 loc) · 1.06 KB
/
profilePane.test.ts
File metadata and controls
28 lines (24 loc) · 1.06 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
/* eslint-env jest */
import $rdf from 'rdflib'
import namespaces from 'solid-namespace'
import { getLabel } from './profilePaneUtils'
const ns = namespaces($rdf as any)
describe('getLabel', () => {
it('should return "Edit your profile" by default', () => {
const mockStore = $rdf.graph()
const mockProfile = $rdf.sym('https://mock-profile')
expect(getLabel(mockProfile, mockStore, ns)).toBe('Edit your profile')
})
it('should return "Your profile" when viewing a Person', () => {
const mockStore = $rdf.graph()
const mockProfile = $rdf.sym('https://mock-profile')
mockStore.add(mockProfile, ns.rdf('type'), ns.foaf('Person'), mockProfile.doc())
expect(getLabel(mockProfile, mockStore, ns)).toBe('Your Profile')
})
it('should return "Your profile" when viewing an Individual', () => {
const mockStore = $rdf.graph()
const mockProfile = $rdf.sym('https://mock-profile')
mockStore.add(mockProfile, ns.rdf('type'), ns.vcard('Individual'), mockProfile.doc())
expect(getLabel(mockProfile, mockStore, ns)).toBe('Your Profile')
})
})