3.6 KB137 lines
Blame
1import { imgSnapshotTest } from '../../helpers/util.ts';
2
3describe('Kanban diagram', () => {
4 it('1: should render a kanban with a single section', () => {
5 imgSnapshotTest(
6 `kanban
7 id1[Todo]
8 docs[Create Documentation]
9 docs[Create Blog about the new diagram]
10 `,
11 {}
12 );
13 });
14 it('2: should render a kanban with multiple sections', () => {
15 imgSnapshotTest(
16 `kanban
17 id1[Todo]
18 docs[Create Documentation]
19 id2
20 docs[Create Blog about the new diagram]
21 `,
22 {}
23 );
24 });
25 it('3: should render a kanban with a single wrapping node', () => {
26 imgSnapshotTest(
27 `kanban
28 id1[Todo]
29 id2[Title of diagram is more than 100 chars when user duplicates diagram with 100 char, wrapping]
30 `,
31 {}
32 );
33 });
34 it('4: should handle the height of a section with a wrapping node at the end', () => {
35 imgSnapshotTest(
36 `kanban
37 id1[Todo]
38 id2[One line]
39 id3[Title of diagram is more than 100 chars when user duplicates diagram with 100 char, wrapping]
40 `,
41 {}
42 );
43 });
44 it('5: should handle the height of a section with a wrapping node at the top', () => {
45 imgSnapshotTest(
46 `kanban
47 id1[Todo]
48 id2[Title of diagram is more than 100 chars when user duplicates diagram with 100 char, wrapping]
49 id3[One line]
50 `,
51 {}
52 );
53 });
54 it('6: should handle the height of a section with a wrapping node in the middle', () => {
55 imgSnapshotTest(
56 `kanban
57 id1[Todo]
58 id2[One line]
59 id3[Title of diagram is more than 100 chars when user duplicates diagram with 100 char, wrapping]
60 id4[One line]
61 `,
62 {}
63 );
64 });
65 it('6: should handle assignments', () => {
66 imgSnapshotTest(
67 `kanban
68 id1[Todo]
69 docs[Create Documentation]
70 id2[In progress]
71 docs[Create Blog about the new diagram]@{ assigned: 'knsv' }
72 `,
73 {}
74 );
75 });
76 it('7: should handle prioritization', () => {
77 imgSnapshotTest(
78 `kanban
79 id2[In progress]
80 vh[Very High]@{ priority: 'Very High' }
81 h[High]@{ priority: 'High' }
82 m[Default priority]
83 l[Low]@{ priority: 'Low' }
84 vl[Very Low]@{ priority: 'Very Low' }
85 `,
86 {}
87 );
88 });
89 it('7: should handle external tickets', () => {
90 imgSnapshotTest(
91 `kanban
92 id1[Todo]
93 docs[Create Documentation]
94 id2[In progress]
95 docs[Create Blog about the new diagram]@{ ticket: MC-2037 }
96 `,
97 {}
98 );
99 });
100 it('8: should handle assignments, prioritization and tickets ids in the same item', () => {
101 imgSnapshotTest(
102 `kanban
103 id2[In progress]
104 docs[Create Blog about the new diagram]@{ priority: 'Very Low', ticket: MC-2037, assigned: 'knsv' }
105 `,
106 {}
107 );
108 });
109 it('10: Full example', () => {
110 imgSnapshotTest(
111 `---
112config:
113 kanban:
114 ticketBaseUrl: 'https://abc123.atlassian.net/browse/#TICKET#'
115---
116kanban
117 id1[Todo]
118 docs[Create Documentation]
119 docs[Create Blog about the new diagram]
120 id7[In progress]
121 id6[Create renderer so that it works in all cases. We also add some extra text here for testing purposes. And some more just for the extra flare.]
122 id8[Design grammar]@{ assigned: 'knsv' }
123 id9[Ready for deploy]
124 id10[Ready for test]
125 id11[Done]
126 id5[define getData]
127 id2[Title of diagram is more than 100 chars when user duplicates diagram with 100 char]@{ ticket: MC-2036, priority: 'Very High'}
128 id3[Update DB function]@{ ticket: MC-2037, assigned: knsv, priority: 'High' }
129 id4[Create parsing tests]@{ ticket: MC-2038, assigned: 'K.Sveidqvist', priority: 'High' }
130 id66[last item]@{ priority: 'Very Low', assigned: 'knsv' }
131 id12[Can't reproduce]
132 `,
133 {}
134 );
135 });
136});
137