Skip to content

Commit

Permalink
Add specs for relation.expandRelation
Browse files Browse the repository at this point in the history
  • Loading branch information
LFDM committed Jun 1, 2014
1 parent 2589ab3 commit abb687b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/arethusa.relation/relation_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,25 @@ describe("relation", function() {
expect(relationLabel.label).toEqual("ATR");
});
});

describe('this.expandRelation', function() {
describe('with two labels', function () {
it('splits a label like PRED_CO into PRED and CO', function() {
var relationLabel = { label: "PRED_CO" };
relation.expandRelation(relationLabel);
expect(relationLabel.prefix).toEqual("PRED");
expect(relationLabel.suffix).toEqual("CO");
});
});

describe('with one label', function () {
it('does not affect single labels like PRED', function() {
var relationLabel = { label: "PRED" };
relation.expandRelation(relationLabel);
expect(relationLabel.prefix).toEqual("PRED");
expect(relationLabel.suffix).toBeUndefined();
});
});
});
});
});

0 comments on commit abb687b

Please sign in to comment.