Repository navigation
Expand file tree
/
Copy pathCheckboxesTest.java
More file actions
79 lines (76 loc) · 2.44 KB
/
Copy pathCheckboxesTest.java
File metadata and controls
79 lines (76 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package elements;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.JsonParser;
import com.slack.api.model.view.View;
import com.slack.api.util.json.GsonFactory;
import org.junit.jupiter.api.Test;
public class CheckboxesTest {
@Test
public void testExample01() {
View view = Checkboxes.example01();
String actual = GsonFactory.createSnakeCase().toJson(view);
String expected = """
{
"type": "modal",
"title": {
"type": "plain_text",
"text": "My App",
"emoji": true
},
"submit": {
"type": "plain_text",
"text": "Submit",
"emoji": true
},
"close": {
"type": "plain_text",
"text": "Cancel",
"emoji": true
},
"blocks": [
{
"type": "section",
"text": {
"type": "plain_text",
"text": "Check out these charming checkboxes"
},
"accessory": {
"type": "checkboxes",
"action_id": "this_is_an_action_id",
"initial_options": [
{
"value": "A1",
"text": {
"type": "plain_text",
"text": "Checkbox 1"
}
}
],
"options": [
{
"value": "A1",
"text": {
"type": "plain_text",
"text": "Checkbox 1"
}
},
{
"value": "A2",
"text": {
"type": "plain_text",
"text": "Checkbox 2"
},
"description": {
"type": "mrkdwn",
"text": "*A description of option two*"
}
}
]
}
}
]
}
""";
assertEquals(JsonParser.parseString(expected), JsonParser.parseString(actual));
}
}