flip boolean
parent
2a82b37068
commit
e3845b3070
|
@ -159,18 +159,18 @@ describe("<Logs />", () => {
|
|||
|
||||
it("toggles raw text display", () => {
|
||||
const wrapper = mount<Logs>(<Logs {...fakeProps()} />);
|
||||
expect(wrapper.state().markdown).toBeFalsy();
|
||||
wrapper.find(".fa-stack").simulate("click");
|
||||
expect(wrapper.state().markdown).toBeTruthy();
|
||||
wrapper.find(".fa-stack").simulate("click");
|
||||
expect(wrapper.state().markdown).toBeFalsy();
|
||||
});
|
||||
|
||||
it("renders formatted messages", () => {
|
||||
const p = fakeProps();
|
||||
p.logs[0].body.message = "`message`";
|
||||
const wrapper = mount<Logs>(<Logs {...p} />);
|
||||
expect(wrapper.state().markdown).toBeFalsy();
|
||||
expect(wrapper.html()).not.toContain("<code>message</code>");
|
||||
wrapper.setState({ markdown: true });
|
||||
expect(wrapper.state().markdown).toBeTruthy();
|
||||
expect(wrapper.html()).toContain("<code>message</code>");
|
||||
wrapper.setState({ markdown: false });
|
||||
expect(wrapper.html()).not.toContain("<code>message</code>");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -50,7 +50,7 @@ export class Logs extends React.Component<LogsProps, Partial<LogsState>> {
|
|||
fun: this.initialize(NumericSetting.fun_log, 1),
|
||||
debug: this.initialize(NumericSetting.debug_log, 1),
|
||||
assertion: this.initialize(NumericSetting.assertion_log, 1),
|
||||
markdown: false,
|
||||
markdown: true,
|
||||
};
|
||||
|
||||
/** Toggle display of a log type. Verbosity level 0 hides all, 3 shows all.*/
|
||||
|
|
Loading…
Reference in New Issue