Fix validation callback to use the uri, not whole row

This commit is contained in:
Daniel Imms
2017-09-24 10:59:38 -07:00
parent 1f49879298
commit a2389d5c5b
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -156,6 +156,17 @@ describe('Linkifier', () => {
linkifier.linkifyRows();
});
it('should validate the uri, not the row', done => {
addRow('abc test abc');
linkifier.registerLinkMatcher(/test/, () => done(), {
validationCallback: (uri, cb) => {
assert.equal(uri, 'test');
done();
}
});
linkifier.linkifyRows();
});
it('should disable link if false', done => {
addRow('test');
linkifier.registerLinkMatcher(/test/, () => assert.fail(), {