Removed accidentally duplicated tests

- this was a result of a bad rebase, these tests should only exist once in their new form
This commit is contained in:
Hannah Wolfe 2021-10-11 14:54:52 +01:00
parent 0bdaa216e5
commit 4ba372d813
No known key found for this signature in database
GPG Key ID: 9F8C7532D0A6BA55

View File

@ -148,41 +148,4 @@ describe('Match helper', function () {
shouldCompileToExpected(templateString, {title}, expected);
});
});
// By using match as a block helper, instead of returning true or false, the matching template is executed
// We've already tested all the logic of the matches, for the block helpers we only need to test that the correct template is executed
describe('{{#match}} (block)', function () {
it('Executes the first block when match is true', function () {
const templateString = '{{#match title "=" "Hello World"}}case a{{else match title "=" "Hello World!"}}case b{{else}}case c{{/match}}';
const hash = {
title: 'Hello World'
};
const expected = 'case a';
shouldCompileToExpected(templateString, hash, expected);
});
it('Executes secondary blocks correctly', function () {
const templateString = '{{#match title "=" "Hello World"}}case a{{else match title "=" "Hello World!"}}case b{{else}}case c{{/match}}';
const hash = {
title: 'Hello World!'
};
const expected = 'case b';
shouldCompileToExpected(templateString, hash, expected);
});
it('Executes the else block when match is false', function () {
const templateString = '{{#match title "=" "Hello World"}}case a{{else match title "=" "Hello World!"}}case b{{else}}case c{{/match}}';
const hash = {
title: 'Hello'
};
const expected = 'case c';
shouldCompileToExpected(templateString, hash, expected);
});
});
});