+
+ beforeEach(() => {
+ context = {
+ params: {
+ language: 'en',
+ },
+ } as any
+ })
+
+ it('should not render anchor when value is a BlankNode', async () => {
+ // given
+ const pointer = blankNode()
+ .addOut(rdfs.label, 'foo')
+
+ // when
+ const result = await fixture(html`${Label.render.call(context, pointer)}
`)
+
+ // then
+ expect(result).dom.to.eq('foo
')
+ })
+
+ it('should use skos:prefLabel before skos:altLabel', async () => {
+ // given
+ const pointer = blankNode()
+ .addOut(skos.prefLabel, 'foo')
+ .addOut(skos.altLabel, 'bar')
+
+ // when
+ const result = await fixture(html`${Label.render.call(context, pointer)}
`)
+
+ // then
+ expect(result).dom.to.eq('foo
')
+ })
+
+ it('should use skos:altLabel before rdfs:label', async () => {
+ // given
+ const pointer = blankNode()
+ .addOut(rdfs.label, 'foo')
+ .addOut(skos.altLabel, 'bar')
+
+ // when
+ const result = await fixture(html`${Label.render.call(context, pointer)}
`)
+
+ // then
+ expect(result).dom.to.eq('bar
')
+ })
+
+ it('should use schema:name before rdfs:label', async () => {
+ // given
+ const pointer = blankNode()
+ .addOut(rdfs.label, 'foo')
+ .addOut(schema.name, 'bar')
+
+ // when
+ const result = await fixture(html`${Label.render.call(context, pointer)}
`)
+
+ // then
+ expect(result).dom.to.eq('bar
')
+ })
+
+ it('should render anchor for named node', async () => {
+ // given
+ const pointer = namedNode('urn:foo:bar')
+ .addOut(rdfs.label, 'baz')
+
+ // when
+ const result = await fixture(Label.render.call(context, pointer))
+
+ // then
+ expect(result).dom.to.eq('baz')
+ })
+})