handle multi-line triggers description, fix #485

This commit is contained in:
Alexander Zobnin
2017-12-14 15:48:32 +03:00
parent 34e829bc23
commit 02d8748d33
16 changed files with 98 additions and 20 deletions

View File

@@ -77,6 +77,19 @@ describe('TriggerPanelCtrl', () => {
});
});
});
describe('When formatting triggers', () => {
beforeEach(() => {
ctx.panelCtrl = createPanelCtrl();
});
it('should handle new lines in trigger description', () => {
ctx.panelCtrl.setTriggerSeverity = jest.fn((trigger) => trigger);
let trigger = {comments: "this is\ndescription"};
const formattedTrigger = ctx.panelCtrl.formatTrigger(trigger);
expect(formattedTrigger.comments).toBe("this is<br>description");
});
});
});
const defaultTrigger = {