Skip to content

Commit 1dae741

Browse files
committed
[tests] adding chips_selector example
1 parent c1b500a commit 1dae741

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

tests/data/flows/6_3/examples.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"chips_selector": {
3+
"version": "6.3",
4+
"screens": [
5+
{
6+
"id": "DEMO_SCREEN",
7+
"terminal": true,
8+
"title": "Demo screen",
9+
"layout": {
10+
"type": "SingleColumnLayout",
11+
"children": [
12+
{
13+
"type": "ChipsSelector",
14+
"name": "chips",
15+
"label": "Personalize your experience",
16+
"description": "Choose your interests to get personalized design ideas and solution",
17+
"max-selected-items": 2,
18+
"data-source": [
19+
{
20+
"id": "room_layout",
21+
"title": "🏡 Room layouts"
22+
},
23+
{
24+
"id": "lighting",
25+
"title": "💡 Lighting"
26+
},
27+
{
28+
"id": "renovation",
29+
"title": "🛠️ Renovation"
30+
},
31+
{
32+
"id": "furnitures",
33+
"title": "📐 Room layouts"
34+
}
35+
]
36+
},
37+
{
38+
"type": "Footer",
39+
"label": "Continue",
40+
"on-click-action": {
41+
"name": "complete",
42+
"payload": {}
43+
}
44+
}
45+
]
46+
}
47+
}
48+
]
49+
}
50+
}

tests/data/flows/6_3/examples.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from pywa.types.flows import * # noqa
2+
3+
chips_selector = FlowJSON(
4+
version="6.3",
5+
screens=[
6+
Screen(
7+
id="DEMO_SCREEN",
8+
terminal=True,
9+
title="Demo screen",
10+
layout=Layout(
11+
type=LayoutType.SINGLE_COLUMN,
12+
children=[
13+
ChipsSelector(
14+
name="chips",
15+
label="Personalize your experience",
16+
description="Choose your interests to get personalized design ideas and solution",
17+
max_selected_items=2,
18+
data_source=[
19+
DataSource(id="room_layout", title="🏡 Room layouts"),
20+
DataSource(id="lighting", title="💡 Lighting"),
21+
DataSource(id="renovation", title="🛠️ Renovation"),
22+
DataSource(id="furnitures", title="📐 Room layouts"),
23+
],
24+
),
25+
Footer(
26+
label="Continue",
27+
on_click_action=CompleteAction(),
28+
),
29+
],
30+
),
31+
),
32+
],
33+
)

0 commit comments

Comments
 (0)