test: check replaced iff translatable comment
All translatable comments should be replaced, but nothing else.
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
d2ecd03013
commit
793fa8fb52
22
curriculum/test/utils/extract-html-comments.test.js
Normal file
22
curriculum/test/utils/extract-html-comments.test.js
Normal file
@ -0,0 +1,22 @@
|
||||
/* global expect */
|
||||
const extractHTMLComments = require('./extract-html-comments');
|
||||
|
||||
const someHTML = `<body>
|
||||
Some text
|
||||
|
||||
<!-- a comment -->
|
||||
|
||||
<!-- a comment --><!-- another comment -->
|
||||
|
||||
</body>
|
||||
`;
|
||||
|
||||
describe('extractHTMLComments', () => {
|
||||
it('should return an object with comment keys and count values', () => {
|
||||
const commentCounts = {
|
||||
'a comment': 2,
|
||||
'another comment': 1
|
||||
};
|
||||
expect(extractHTMLComments(someHTML)).toEqual(commentCounts);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user