コード例 #1
0
ファイル: test.js プロジェクト: bmcmahen/markup
 it('should return the created tag', function () {
   var el = markup(10, 15, this.el, 'a');
   el.href = 'http://bacon.com/';
   expect(el).to.be.ok();
   expect(el.innerText).to.be('would');
   expect(el.href).to.be('http://bacon.com/');
 });
コード例 #2
0
ファイル: test.js プロジェクト: bmcmahen/markup
 it('should be able to set different tagname to same indexes', function () {
   this.el.innerHTML = 'hello world';
   markup(0, 11, this.el, 'b');
   var el = markup(0, 11, this.el, 'i');
   expect(el).to.be.ok();
 });
コード例 #3
0
ファイル: test.js プロジェクト: bmcmahen/markup
 it('should set optional attributes', function () {
   var el = markup(10, 15, this.el, 'a', { href: 'http://benmcmahen.com/' });
   expect(el.href).to.be('http://benmcmahen.com/');
 });
コード例 #4
0
ファイル: test.js プロジェクト: bmcmahen/markup
 it('should work with a variety of tags', function () {
   markup(10, 15, this.el, 'i');
   var $i = $(this.el).find('i');
   expect($i).to.have.length(1);
   expect($i.text()).to.be('would');
 });
コード例 #5
0
ファイル: test.js プロジェクト: bmcmahen/markup
 it('should insert tags in the correct position', function () {
   markup(0, 9, this.el, 'b');
   var $b = $(this.el).find('b');
   expect($b).to.have.length(1);
   expect($b.text()).to.be('aristotle');
 });