unexpected-htmllike
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -18,1 +18,5 @@ | ||
* Minor improvements to display of elements with children with attributes that need more than one line | ||
### v0.3.2 | ||
* Fix bug with children being non-exact whilst ignoring the bits that aren't exact. e.g. you ignore extra attributes, | ||
and have an extra attribute on a child, a `contains` check would not find the element. |
@@ -442,3 +442,3 @@ 'use strict'; | ||
diffElementOrWrapper(actualAdapter, expectedAdapter, a, b, expect, options).then(function (elementDiff) { | ||
return callback(elementDiff.weight.total === WEIGHT_OK); | ||
return callback(elementDiff.weight.real === WEIGHT_OK); | ||
}); | ||
@@ -445,0 +445,0 @@ }, function (a, b, aIndex, bIndex, callback) { |
@@ -206,3 +206,32 @@ 'use strict'; | ||
}); | ||
it('finds a nested component with missing children and extra attribute', function () { | ||
return expect({ | ||
name: 'div', attribs: {}, children: [{ | ||
name: 'span', | ||
attribs: {}, | ||
children: ['one'] | ||
}, { | ||
name: 'span', | ||
attribs: { className: 'dummy' }, | ||
children: ['two'] | ||
}, { | ||
name: 'span', | ||
attribs: {}, | ||
children: ['three'] | ||
}] | ||
}, 'when checked with options to contain', { diffExtraChildren: false, diffExtraAttributes: false }, { | ||
name: 'div', attribs: {}, children: [{ | ||
name: 'span', | ||
attribs: {}, | ||
children: ['two'] | ||
}] | ||
}, 'to satisfy', { | ||
found: true, | ||
bestMatch: { | ||
weight: 0 | ||
} | ||
}); | ||
}); | ||
}); | ||
//# sourceMappingURL=contains.spec.js.map |
{ | ||
"name": "unexpected-htmllike", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Helper library for unexpected plugins that perform assertions on XML like structures", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -445,3 +445,3 @@ import ArrayChangesAsync from 'array-changes-async'; | ||
diffElementOrWrapper(actualAdapter, expectedAdapter, a, b, expect, options).then(elementDiff => { | ||
return callback(elementDiff.weight.total === WEIGHT_OK); | ||
return callback(elementDiff.weight.real === WEIGHT_OK); | ||
}); | ||
@@ -448,0 +448,0 @@ }, |
@@ -248,2 +248,37 @@ import Unexpected from 'unexpected'; | ||
}); | ||
it('finds a nested component with missing children and extra attribute', () => { | ||
return expect({ | ||
name: 'div', attribs: {}, children: [ | ||
{ | ||
name: 'span', | ||
attribs: {}, | ||
children: [ 'one' ] | ||
}, | ||
{ | ||
name: 'span', | ||
attribs: { className: 'dummy' }, | ||
children: [ 'two' ] | ||
}, | ||
{ | ||
name: 'span', | ||
attribs: {}, | ||
children: [ 'three' ] | ||
} | ||
] | ||
}, 'when checked with options to contain', { diffExtraChildren: false, diffExtraAttributes: false }, { | ||
name: 'div', attribs: {}, children: [ | ||
{ | ||
name: 'span', | ||
attribs: {}, | ||
children: [ 'two' ] | ||
} | ||
] | ||
}, 'to satisfy', { | ||
found: true, | ||
bestMatch: { | ||
weight: 0 | ||
} | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1045978
9554