Add StringCollection to make it easier to work with strings

This commit is contained in:
Kim Biesbjerg
2016-12-09 05:18:04 +01:00
parent befd841457
commit 73801a9cc5
17 changed files with 204 additions and 111 deletions

View File

@@ -14,20 +14,20 @@ describe('PipeParser', () => {
it('should extract interpolated strings using translate pipe', () => {
const contents = `Hello {{ 'World' | translate }}`;
const messages = parser.process(templateFilename, contents);
expect(messages).to.deep.equal(['World']);
const keys = parser.extract(contents, templateFilename).keys();
expect(keys).to.deep.equal(['World']);
});
it('should extract interpolated strings using translate pipe in attributes', () => {
const contents = `<span attr="{{ 'Hello World' | translate }}"></span>`;
const messages = parser.process(templateFilename, contents);
expect(messages).to.deep.equal(['Hello World']);
const keys = parser.extract(contents, templateFilename).keys();
expect(keys).to.deep.equal(['Hello World']);
});
it('should extract bound strings using translate pipe in attributes', () => {
const contents = `<span [attr]="'Hello World' | translate"></span>`;
const messages = parser.process(templateFilename, contents);
expect(messages).to.deep.equal(['Hello World']);
const keys = parser.extract(contents, templateFilename).keys();
expect(keys).to.deep.equal(['Hello World']);
});
});