Skip to content

Commit 5b65d04

Browse files
committed
#222 add new monolog mock
1 parent 4e1bfa7 commit 5b65d04

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import monologExtendedMock from './monolog-extended.json';
12
import monologMock from './monolog.json';
23

34
export {
45
monologMock,
6+
monologExtendedMock,
57
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"uuid": "019059fe-9284-71fe-9e47-a392664a8c87",
3+
"project": null,
4+
"type": "monolog",
5+
"payload": {
6+
"channel": "application",
7+
"context": {
8+
"cool": "heck yeah",
9+
"here": "where?"
10+
},
11+
"datetime": "2024-06-27T15:59:34.201624+02:00",
12+
"extra": {
13+
"callType": null,
14+
"class": null,
15+
"file": "[REDACTED]",
16+
"function": "[REDACTED]",
17+
"http_method": "GET",
18+
"instance": "[REDACTED]",
19+
"ip": "[REDACTED]",
20+
"line": 514,
21+
"referrer": null,
22+
"server": "[REDACTED]",
23+
"url": "[REDACTED]"
24+
},
25+
"level": 200,
26+
"level_name": "INFO",
27+
"message": "Hello world"
28+
},
29+
"timestamp": 1719496774.2804
30+
}

src/entities/monolog/ui/preview-card/preview-card.stories.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Meta, StoryObj } from "@storybook/vue3";
22
import { useMonolog } from "../../lib";
3-
import { monologMock } from '../../mocks'
3+
import { monologMock, monologExtendedMock } from '../../mocks'
44
import PreviewCard from './preview-card.vue';
55

66
const { normalizeMonologEvent } = useMonolog();
@@ -28,3 +28,9 @@ export const WithOrigin: StoryObj<typeof PreviewCard> = {
2828
}
2929
}
3030
}
31+
32+
export const ComplexObject: StoryObj<typeof PreviewCard> = {
33+
args: {
34+
event: normalizeMonologEvent(monologExtendedMock),
35+
}
36+
}

src/shared/stores/profile/profile-store.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ export const useProfileStore = defineStore("profileStore", {
3434
return new Error('Auth Error')
3535
}
3636

37-
return response
37+
return response.json()
3838
})
39-
.then((response) => response.json())
4039
.catch((e) => {
4140
console.error(e);
4241

0 commit comments

Comments
 (0)