Skip to content

Commit

Permalink
fix spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
mbest committed Sep 29, 2017
1 parent cee294c commit 0729145
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions spec/defaultBindings/attrBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ describe('Binding: Attr', function() {
expect(testNode.childNodes[0].getAttribute("second-attribute")).toEqual("true");
});

it('Should be able to set namespaced attribute values', function() {
var model = { myValue: "first value" };
testNode.innerHTML = [
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">',
'<g>',
'<a data-bind="attr: { \'xlink:href\': myValue }">',
'<text>foo</text>',
'</a>',
'</g>',
'</svg>'
].join('');
it('Should be able to set namespaced attribute values', function() {
var model = { myValue: "first value" };
testNode.innerHTML = [
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">',
'<g>',
'<a data-bind="attr: { \'xlink:href\': myValue }">',
'<text>foo</text>',
'</a>',
'</g>',
'</svg>'
].join('');

ko.applyBindings(model, testNode);
var anchor = testNode.childNodes[0]/*svg*/.childNodes[0]/*g*/.childNodes[0]/*a*/;
expect( anchor.getAttributeNode('xlink:href').value ).toEqual( 'first value' );
expect( anchor.getAttributeNode('xlink:href').namespaceURI ).toEqual( 'http://www.w3.org/1999/xlink' );
});
var anchor = testNode.childNodes[0]/*svg*/.childNodes[0]/*g*/.childNodes[0]/*a*/;
expect( anchor.getAttributeNode('xlink:href').value ).toEqual( 'first value' );
expect( anchor.getAttributeNode('xlink:href').namespaceURI ).toEqual( 'http://www.w3.org/1999/xlink' );
});

it('Should be able to set \"name\" attribute, even on IE6-7', function() {
var myValue = ko.observable("myName");
Expand Down

0 comments on commit 0729145

Please sign in to comment.