Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions block-kit/tests/blocks/test_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def test_example01():
{
"type": "text",
"text": "Searched database...",
}
},
],
}
},
],
},
"output": {
Expand All @@ -40,9 +40,9 @@ def test_example01():
{
"type": "text",
"text": "Profile data loaded",
}
},
],
}
},
],
},
},
Expand All @@ -67,9 +67,9 @@ def test_example01():
{
"type": "text",
"text": "15 data points compiled",
}
},
],
}
},
],
},
},
Expand Down
80 changes: 55 additions & 25 deletions block-kit/tests/blocks/test_rich_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def test_example01():
{
"type": "text",
"text": "Hello there, I am a basic rich text block!",
}
},
],
}
},
],
},
{
Expand All @@ -39,7 +39,7 @@ def test_example01():
},
},
],
}
},
],
},
{
Expand All @@ -60,7 +60,7 @@ def test_example01():
},
},
],
}
},
],
},
{
Expand All @@ -81,7 +81,7 @@ def test_example01():
},
},
],
}
},
],
},
]
Expand All @@ -101,7 +101,7 @@ def test_example02():
{
"type": "text",
"text": "My favorite Slack features (in no particular order):",
}
},
],
},
{
Expand Down Expand Up @@ -221,7 +221,7 @@ def test_example03():
"text": "Pancakes, extra syrup",
},
],
}
},
],
},
],
Expand All @@ -241,10 +241,10 @@ def test_example04():
{
"type": "text",
"text": '{\n "object": {\n "description": "this is an example of a json object"\n }\n}',
}
},
],
"border": 0,
}
},
],
}
assert json.dumps(actual, sort_keys=True) == json.dumps(expected, sort_keys=True)
Expand All @@ -263,7 +263,7 @@ def test_example05():
{
"type": "text",
"text": "What we need is good examples in our documentation.",
}
},
],
},
{
Expand All @@ -288,8 +288,13 @@ def test_example06():
"elements": [
{
"type": "rich_text_section",
"elements": [{"type": "broadcast", "range": "everyone"}],
}
"elements": [
{
"type": "broadcast",
"range": "everyone",
},
],
},
],
}
assert json.dumps(actual, sort_keys=True) == json.dumps(expected, sort_keys=True)
Expand All @@ -303,8 +308,13 @@ def test_example07():
"elements": [
{
"type": "rich_text_section",
"elements": [{"type": "color", "value": "#F405B3"}],
}
"elements": [
{
"type": "color",
"value": "#F405B3",
},
],
},
],
}
assert json.dumps(actual, sort_keys=True) == json.dumps(expected, sort_keys=True)
Expand All @@ -318,8 +328,13 @@ def test_example08():
"elements": [
{
"type": "rich_text_section",
"elements": [{"type": "channel", "channel_id": "C123ABC456"}],
}
"elements": [
{
"type": "channel",
"channel_id": "C123ABC456",
},
],
},
],
}
assert json.dumps(actual, sort_keys=True) == json.dumps(expected, sort_keys=True)
Expand All @@ -339,9 +354,9 @@ def test_example09():
"timestamp": 1720710212,
"format": "{date_num} at {time}",
"fallback": "timey",
}
},
],
}
},
],
}
assert json.dumps(actual, sort_keys=True) == json.dumps(expected, sort_keys=True)
Expand Down Expand Up @@ -377,7 +392,7 @@ def test_example10():
"name": "checkered_flag",
},
],
}
},
],
}
assert json.dumps(actual, sort_keys=True) == json.dumps(expected, sort_keys=True)
Expand All @@ -391,8 +406,13 @@ def test_example11():
"elements": [
{
"type": "rich_text_section",
"elements": [{"type": "link", "url": "https://api.slack.com"}],
}
"elements": [
{
"type": "link",
"url": "https://api.slack.com",
},
],
},
],
}
assert json.dumps(actual, sort_keys=True) == json.dumps(expected, sort_keys=True)
Expand All @@ -406,8 +426,13 @@ def test_example12():
"elements": [
{
"type": "rich_text_section",
"elements": [{"type": "user", "user_id": "U123ABC456"}],
}
"elements": [
{
"type": "user",
"user_id": "U123ABC456",
},
],
},
],
}
assert json.dumps(actual, sort_keys=True) == json.dumps(expected, sort_keys=True)
Expand All @@ -421,8 +446,13 @@ def test_example13():
"elements": [
{
"type": "rich_text_section",
"elements": [{"type": "usergroup", "usergroup_id": "G123ABC456"}],
}
"elements": [
{
"type": "usergroup",
"usergroup_id": "G123ABC456",
},
],
},
],
}
assert json.dumps(actual, sort_keys=True) == json.dumps(expected, sort_keys=True)
36 changes: 26 additions & 10 deletions block-kit/tests/blocks/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,29 @@ def test_example01():
expected = {
"type": "table",
"column_settings": [
{"is_wrapped": True},
{"align": "right"},
{
"is_wrapped": True,
},
{
"align": "right",
},
],
"rows": [
[
{"type": "raw_text", "text": "Header A"},
{"type": "raw_text", "text": "Header B"},
{
"type": "raw_text",
"text": "Header A",
},
{
"type": "raw_text",
"text": "Header B",
},
],
[
{"type": "raw_text", "text": "Data 1A"},
{
"type": "raw_text",
"text": "Data 1A",
},
{
"type": "rich_text",
"elements": [
Expand All @@ -29,14 +42,17 @@ def test_example01():
"type": "link",
"text": "Data 1B",
"url": "https://slack.com",
}
},
],
}
},
],
},
],
[
{"type": "raw_text", "text": "Data 2A"},
{
"type": "raw_text",
"text": "Data 2A",
},
{
"type": "rich_text",
"elements": [
Expand All @@ -47,9 +63,9 @@ def test_example01():
"type": "link",
"text": "Data 2B",
"url": "https://slack.com",
}
},
],
}
},
],
},
],
Expand Down
4 changes: 2 additions & 2 deletions block-kit/tests/blocks/test_task_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ def test_example01():
{
"type": "text",
"text": "Found weather data for Chicago from 2 sources",
}
},
],
}
},
],
},
"sources": [
Expand Down