Navigation Menu

Skip to content

Commit

Permalink
Add a test for parsed relations in case user has a patched version of…
Browse files Browse the repository at this point in the history
… jsdom
  • Loading branch information
bergie committed Mar 9, 2011
1 parent f91c2a0 commit 0c6f566
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/rdfa.js
@@ -1,8 +1,8 @@
var jQuery = require('jquery');
var VIE = require('../vie.js');

// Until https://github.com/tmpvar/jsdom/issues/issue/81 is fixed
VIE.RDFa.predicateSelector = '[property]';
// Until https://github.com/tmpvar/jsdom/issues/issue/81 is fixed you need to uncomment the following:
//VIE.RDFa.predicateSelector = '[property]';

exports['test inheriting subject'] = function(test) {
var html = jQuery('<div about="http://dbpedia.org/resource/Albert_Einstein"><span property="foaf:name">Albert Einstein</span><span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span><div rel="dbp:birthPlace" resource="http://dbpedia.org/resource/Germany" /><span about="http://dbpedia.org/resource/Germany" property="dbp:conventionalLongName">Federal Republic of Germany</span></div>');
Expand All @@ -12,6 +12,7 @@ exports['test inheriting subject'] = function(test) {

test.equal(jsonldEntities[1]['foaf:name'], 'Albert Einstein');
test.equal(jsonldEntities[0]['dbp:conventionalLongName'], 'Federal Republic of Germany');
test.equals(jsonldEntities[1]['dbp:birthPlace'], '<' + jsonldEntities[0]['@'] + '>', "Check that the relation between the person and the birthplace was read correctly");

var backboneEntities = VIE.RDFaEntities.getInstances(html);
test.equal(backboneEntities.length, 2, "This RDFa defines two entities but they don't get to Backbone");
Expand Down

0 comments on commit 0c6f566

Please sign in to comment.