MCPcopy Create free account
hub / github.com/bytebase/bytebase / TestContext_getMetaList

Function TestContext_getMetaList

backend/plugin/webhook/webhook_test.go:10–68  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestContext_getMetaList(t *testing.T) {
11 t.Run("Issue with Creator", func(t *testing.T) {
12 a := require.New(t)
13 context := Context{
14 Issue: &Issue{
15 Name: "Issue 101",
16 Description: "Fix critical bug",
17 Creator: Creator{
18 Name: "Alice",
19 Email: "alice@example.com",
20 },
21 },
22 }
23 want := []Meta{
24 {
25 Name: "Issue",
26 Value: "Issue 101",
27 },
28 {
29 Name: "Issue Creator",
30 Value: "Alice (alice@example.com)",
31 },
32 {
33 Name: "Issue Description",
34 Value: "Fix critical bug",
35 },
36 }
37 a.Equal(want, context.GetMetaList())
38 })
39
40 t.Run("Issue with Creator Zh", func(t *testing.T) {
41 a := require.New(t)
42 context := Context{
43 Issue: &Issue{
44 Name: "Issue 101",
45 Description: "Fix critical bug",
46 Creator: Creator{
47 Name: "Alice",
48 Email: "alice@example.com",
49 },
50 },
51 }
52 want := []Meta{
53 {
54 Name: "工单",
55 Value: "Issue 101",
56 },
57 {
58 Name: "工单创建者",
59 Value: "Alice (alice@example.com)",
60 },
61 {
62 Name: "工单描述",
63 Value: "Fix critical bug",
64 },
65 }
66 a.Equal(want, context.GetMetaListZh())
67 })

Callers

nothing calls this directly

Calls 4

GetMetaListMethod · 0.95
GetMetaListZhMethod · 0.95
EqualMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected