Skip to content

Commit

Permalink
Revert "Tweaking output of the to satisfy on style"
Browse files Browse the repository at this point in the history
This reverts commit a66edd7.
  • Loading branch information
sunesimonsen committed Mar 28, 2018
1 parent 1dccc71 commit e865fde
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
11 changes: 6 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,6 @@ module.exports = {
if (typeof value === 'string') {
value = getClassNamesFromAttributeValue(value);
}

return topLevelExpect(
actualClasses.sort(),
'to equal',
Expand Down Expand Up @@ -1010,7 +1009,6 @@ module.exports = {
expectedAttributeNames.push(attributeName);
});

expect.errorMode = 'diff';
expectedAttributeNames.forEach(function(attributeName) {
var attributeValue = subject.getAttribute(attributeName);
var expectedAttributeValue =
Expand Down Expand Up @@ -1053,13 +1051,17 @@ module.exports = {
}

if (onlyAttributes) {
return expect(
return topLevelExpect(
attrs.style,
'to exhaustively satisfy',
expectedStyleObj
);
} else {
return expect(attrs.style, 'to satisfy', expectedStyleObj);
return topLevelExpect(
attrs.style,
'to satisfy',
expectedStyleObj
);
}
} else if (expectedAttributeValue === true) {
topLevelExpect(
Expand All @@ -1080,7 +1082,6 @@ module.exports = {
}
});
});
expect.errorMode = 'default';

promiseByKey.attributePresence = expect.promise(function() {
var attributeNamesExpectedToBeDefined = [];
Expand Down
8 changes: 6 additions & 2 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,9 @@ describe('unexpected-dom', function() {
'expected <div style="width: 120px">hey</div> to satisfy <div style="color: tan;">hey</div>\n' +
'\n' +
'<div\n' +
' style="width: 120px" // {\n' +
" style=\"width: 120px\" // expected { width: '120px' } to satisfy { color: 'tan' }\n" +
' //\n' +
' // {\n' +
" // width: '120px'\n" +
" // // missing color: 'tan'\n" +
' // }\n' +
Expand Down Expand Up @@ -1730,7 +1732,9 @@ describe('unexpected-dom', function() {
'expected <div style="width: 120px">hey</div> to satisfy <div style="color: tan">hey</div>\n' +
'\n' +
'<div\n' +
' style="width: 120px" // {\n' +
" style=\"width: 120px\" // expected { width: '120px' } to satisfy { color: 'tan' }\n" +
' //\n' +
' // {\n' +
" // width: '120px'\n" +
" // // missing color: 'tan'\n" +
' // }\n' +
Expand Down

0 comments on commit e865fde

Please sign in to comment.