Skip to content

Commit

Permalink
Fixes publish-validation test
Browse files Browse the repository at this point in the history
  • Loading branch information
cperryk committed Dec 28, 2016
1 parent b2ce59f commit 9554a5f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion services/publish-validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe('publish-validation service', function () {
sandbox.spy(dom, 'create');
sandbox.stub(dom, 'find');
sandbox.stub(dom, 'findAll');
sandbox.stub(document.documentElement, 'getAttribute'),
sandbox.stub(edit);
});

Expand Down Expand Up @@ -76,9 +77,19 @@ describe('publish-validation service', function () {

dom.findAll.withArgs('[data-uri]').returns([dom.create('<section data-uri="' + ref + '" />')]);
edit.getData.withArgs(ref).returns(Promise.resolve(data));
document.documentElement.getAttribute.withArgs('data-layout-uri').returns('localhost/selectall/components/layout/instances/article');
edit.getData.withArgs('localhost/selectall/components/layout/instances/article').returns(Promise.resolve({foo: 'bar'}));

return fn(rules).then(function () {
expect(spy.args[0][0]).to.deep.equal({refs: {'/components/a': {}}, components: ['a']});
expect(spy.args[0][0]).to.deep.equal({
refs: {
'/components/a': {}
},
components: ['a'],
layout: {
foo: 'bar'
}
});
});
});
});
Expand Down

0 comments on commit 9554a5f

Please sign in to comment.