Clicking a link in the HTML reporter does exact filtering
This feature requires an update to boot1.js, as shown in this commit. Users with an older boot1.js will get the older inexact filtering.
This commit is contained in:
49
spec/html/HtmlExactSpecFilterSpec.js
Normal file
49
spec/html/HtmlExactSpecFilterSpec.js
Normal file
@@ -0,0 +1,49 @@
|
||||
describe('HtmlExactSpecFilter', function() {
|
||||
it('matches everything when no string is provided', function() {
|
||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
||||
filterString() {
|
||||
return '';
|
||||
}
|
||||
});
|
||||
|
||||
expect(specFilter.matches({})).toBeTrue();
|
||||
});
|
||||
|
||||
it('matches a spec with the exact same path', function() {
|
||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
||||
filterString() {
|
||||
return '["a","b","c"]';
|
||||
}
|
||||
});
|
||||
|
||||
expect(specFilter.matches(stubSpec(['a', 'b', 'c']))).toBeTrue();
|
||||
});
|
||||
|
||||
it('matches a spec whose path has the filter path as a prefix', function() {
|
||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
||||
filterString() {
|
||||
return '["a","b"]';
|
||||
}
|
||||
});
|
||||
|
||||
expect(specFilter.matches(stubSpec(['a', 'b', 'c']))).toBeTrue();
|
||||
});
|
||||
|
||||
it('does not match a spec with a different path', function() {
|
||||
const specFilter = new jasmineUnderTest.HtmlExactSpecFilter({
|
||||
filterString() {
|
||||
return '["a","b","c"]';
|
||||
}
|
||||
});
|
||||
|
||||
expect(specFilter.matches(stubSpec(['a', 'd', 'c']))).toBeFalse();
|
||||
});
|
||||
|
||||
function stubSpec(path) {
|
||||
return {
|
||||
getPath() {
|
||||
return path;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user