Clipper: Refactored image rules to re-use more code

This commit is contained in:
Laurent Cozic
2019-07-15 20:43:28 +00:00
parent c75618eb8f
commit fbb0ac5892
5 changed files with 76 additions and 48 deletions
+15
View File
@@ -30,4 +30,19 @@ describe('htmlUtils', function() {
done();
});
it('should encode attributes', async (done) => {
const testCases = [
[{ a: 'one', b: 'two' }, 'a="one" b="two"'],
[{ a: 'one&two' }, 'a="one&two"'],
];
for (let i = 0; i < testCases.length; i++) {
const attrs = testCases[i][0];
const expected = testCases[i][1];
expect(htmlUtils.attributesHtml(attrs)).toBe(expected);
}
done();
});
});