mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-25 23:03:47 +01:00
@@ -81,7 +81,7 @@ describe("<LogEventSource />", () => {
|
||||
expect(messageWithoutKey).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"date": 2019-06-12T10:55:42.459Z,
|
||||
"message": "\\"This is a message.\\"",
|
||||
"message": " \\"This is a message.\\"",
|
||||
}
|
||||
`);
|
||||
});
|
||||
@@ -98,7 +98,7 @@ describe("<LogEventSource />", () => {
|
||||
expect(messageWithoutKey).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"date": 2020-04-27T10:35:43.272Z,
|
||||
"message": "xxxxx",
|
||||
"message": " xxxxx",
|
||||
}
|
||||
`);
|
||||
});
|
||||
@@ -116,7 +116,7 @@ describe("<LogEventSource />", () => {
|
||||
expect(messageWithoutKey).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"date": 2019-06-12T10:55:42.459Z,
|
||||
"message": "\\"This is a message.\\"",
|
||||
"message": " \\"This is a message.\\"",
|
||||
}
|
||||
`);
|
||||
});
|
||||
@@ -124,7 +124,9 @@ describe("<LogEventSource />", () => {
|
||||
describe("render html correctly", () => {
|
||||
const RealDate = Date;
|
||||
beforeAll(() => {
|
||||
global.Date = class extends RealDate {
|
||||
global.Date = class extends (
|
||||
RealDate
|
||||
) {
|
||||
constructor(arg) {
|
||||
if (arg) {
|
||||
return new RealDate(arg);
|
||||
@@ -144,7 +146,7 @@ describe("<LogEventSource />", () => {
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(wrapper.find("ul.events")).toMatchInlineSnapshot(`
|
||||
<ul class="events medium">
|
||||
<li class=""><span class="date"><time datetime="2019-06-12T10:55:42.459Z">today at 10:55 AM</time></span> <span class="text">"This is a message."</span></li>
|
||||
<li class=""><span class="date"><time datetime="2019-06-12T10:55:42.459Z">today at 10:55 AM</time></span> <span class="text"> "This is a message."</span></li>
|
||||
</ul>
|
||||
`);
|
||||
});
|
||||
@@ -159,7 +161,7 @@ describe("<LogEventSource />", () => {
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(wrapper.find("ul.events")).toMatchInlineSnapshot(`
|
||||
<ul class="events medium">
|
||||
<li class=""><span class="date"><time datetime="2019-06-12T10:55:42.459Z">today at 10:55 AM</time></span> <span class="text"><span style="color:#000">black<span style="color:#AAA">white</span></span></span></li>
|
||||
<li class=""><span class="date"><time datetime="2019-06-12T10:55:42.459Z">today at 10:55 AM</time></span> <span class="text"> <span style="color:#000">black<span style="color:#AAA">white</span></span></span></li>
|
||||
</ul>
|
||||
`);
|
||||
});
|
||||
@@ -174,7 +176,7 @@ describe("<LogEventSource />", () => {
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(wrapper.find("ul.events")).toMatchInlineSnapshot(`
|
||||
<ul class="events medium">
|
||||
<li class=""><span class="date"><time datetime="2019-06-12T10:55:42.459Z">today at 10:55 AM</time></span> <span class="text"><test>foo bar</test></span></li>
|
||||
<li class=""><span class="date"><time datetime="2019-06-12T10:55:42.459Z">today at 10:55 AM</time></span> <span class="text"> <test>foo bar</test></span></li>
|
||||
</ul>
|
||||
`);
|
||||
});
|
||||
@@ -192,7 +194,7 @@ describe("<LogEventSource />", () => {
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(wrapper.find("ul.events")).toMatchInlineSnapshot(`
|
||||
<ul class="events medium">
|
||||
<li class=""><span class="date"><time datetime="2019-06-12T10:55:42.459Z">today at 10:55 AM</time></span> <span class="text">This is a <mark>test</mark> <hi></hi></span></li>
|
||||
<li class=""><span class="date"><time datetime="2019-06-12T10:55:42.459Z">today at 10:55 AM</time></span> <span class="text"> This is a <mark>test</mark> <hi></hi></span></li>
|
||||
</ul>
|
||||
`);
|
||||
});
|
||||
|
||||
@@ -84,7 +84,7 @@ export default {
|
||||
}
|
||||
const key = data.substring(0, i);
|
||||
const date = new Date(key);
|
||||
const message = data.substring(i).trim();
|
||||
const message = data.substring(i);
|
||||
return { key, date, message };
|
||||
},
|
||||
},
|
||||
|
||||
@@ -145,7 +145,7 @@ func logReader(reader io.ReadCloser, tty bool) func() (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return strings.TrimSpace(buffer.String()), nil
|
||||
return buffer.String(), nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user