mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 19:35:41 +03:00
Return a htmlSafe string rather than use triple curlies
This commit is contained in:
@@ -18,5 +18,5 @@
|
||||
</span>
|
||||
</div>
|
||||
<div data-test-log-box class="boxed-section-body is-dark is-full-bleed">
|
||||
<pre data-test-log-cli class="cli-window"><code>{{{logger.output}}}</code></pre>
|
||||
<pre data-test-log-cli class="cli-window"><code>{{logger.output}}</code></pre>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { alias } from '@ember/object/computed';
|
||||
import { assert } from '@ember/debug';
|
||||
import { htmlSafe } from '@ember/template';
|
||||
import Evented from '@ember/object/evented';
|
||||
import EmberObject, { computed } from '@ember/object';
|
||||
import { assign } from '@ember/polyfills';
|
||||
@@ -39,7 +40,8 @@ const Log = EmberObject.extend(Evented, {
|
||||
// the logPointer is pointed at head or tail
|
||||
output: computed('logPointer', 'head', 'tail', function() {
|
||||
let logs = this.logPointer === 'head' ? this.head : this.tail;
|
||||
return Anser.ansiToHtml(logs);
|
||||
let colouredLogs = Anser.ansiToHtml(logs);
|
||||
return htmlSafe(colouredLogs);
|
||||
}),
|
||||
|
||||
init() {
|
||||
|
||||
@@ -100,9 +100,9 @@ module('Unit | Util | Log', function(hooks) {
|
||||
});
|
||||
|
||||
await settled();
|
||||
assert.ok(log.get('output').endsWith(truncationMessage), 'Truncation message is shown');
|
||||
assert.ok(log.get('output').toString().endsWith(truncationMessage), 'Truncation message is shown');
|
||||
assert.equal(
|
||||
log.get('output').length,
|
||||
log.get('output').toString().length,
|
||||
50000 + truncationMessage.length,
|
||||
'Output is truncated the appropriate amount'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user