Prettify unit test for stdout-parse service

This commit is contained in:
jaredevantabor 2016-11-18 13:27:02 -08:00
parent 38a9720fc7
commit 0aac35e09a

View File

@ -18,6 +18,21 @@ describe('parseStdoutService', () => {
parseStdoutService = _parseStdoutService_;
}));
describe('prettify()', () => {
it('returns lines of stdout with styling classes', () => {
let line = "[0;32mok: [host-00]",
styledLine = '<span class="ansi32">ok: [host-00]</span>';
expect(parseStdoutService.prettify(line).toBe(styledLine));
});
it('can return lines of stdout without styling classes', () => {
let line = "[0;32mok: [host-00]",
unstyled = "unstyled",
unstyledLine = 'ok: [host-00]';
expect(parseStdoutService.prettify(line, unstyled).toBe(unstyledLine));
});
});
describe('getCollapseIcon()', () => {
let emptySpan = `
<span class="JobResultsStdOut-lineExpander"></span>`;
@ -54,7 +69,7 @@ describe('parseStdoutService', () => {
</span>`;
expect(parseStdoutService.getCollapseIcon(headerEvent, line))
.toBe(expandSpan);
})
});
});
describe('getLineArr()', () => {