30
30
FillerComponent ,
31
31
IconComponent ,
32
32
SpacerComponent ,
33
+ SpanComponent ,
33
34
URIAction ,
34
35
)
35
36
from tests .models .serialize_test_case import SerializeTestCase
@@ -44,7 +45,7 @@ def test_flex_message(self):
44
45
body = BoxComponent (
45
46
layout = 'vertical' ,
46
47
contents = [
47
- TextComponent (text = 'hello' , wrap = True , maxLines = 1 ),
48
+ TextComponent (text = 'hello' , wrap = True , max_lines = 1 ),
48
49
TextComponent (text = 'world' )
49
50
]
50
51
)
@@ -140,7 +141,11 @@ def test_box_component(self):
140
141
ImageComponent (url = 'https://example.com/flex/images/image.jpg' ),
141
142
SeparatorComponent (),
142
143
TextComponent (text = 'Text in the box' ),
143
- ]
144
+ ],
145
+ 'background_color' : '#00000000' ,
146
+ 'border_width' : 'light' ,
147
+ 'corner_radius' : 'xs' ,
148
+ 'flex' : 2
144
149
}
145
150
146
151
self .assertEqual (
@@ -162,7 +167,9 @@ def test_button_component(self):
162
167
)
163
168
164
169
def test_filler_component (self ):
165
- arg = {}
170
+ arg = {
171
+ 'flex' : 2
172
+ }
166
173
self .assertEqual (
167
174
self .serialize_as_dict (arg , type = self .FILLER ),
168
175
FillerComponent (** arg ).as_json_dict ()
@@ -192,7 +199,8 @@ def test_image_component(self):
192
199
193
200
def test_separator_component (self ):
194
201
arg = {
195
- 'color' : '#000000'
202
+ 'color' : '#000000' ,
203
+ 'margin' : 'xxl'
196
204
}
197
205
self .assertEqual (
198
206
self .serialize_as_dict (arg , type = self .SEPARATOR ),
@@ -208,12 +216,31 @@ def test_spacer_component(self):
208
216
SpacerComponent (** arg ).as_json_dict ()
209
217
)
210
218
219
+ def test_span_component (self ):
220
+ arg = {
221
+ 'type' : 'span' ,
222
+ 'text' : '蛙' ,
223
+ 'size' : 'xxl' ,
224
+ 'weight' : 'bold' ,
225
+ 'style' : 'italic' ,
226
+ 'color' : '#4f8f00' ,
227
+ 'decoration' : 'underline'
228
+ }
229
+ self .assertEqual (
230
+ self .serialize_as_dict (arg , type = self .SPAN ),
231
+ SpanComponent (** arg ).as_json_dict ()
232
+ )
233
+
211
234
def test_text_component (self ):
212
235
arg = {
213
236
'text' : 'Hello, World!' ,
214
237
'size' : 'xl' ,
215
238
'weight' : 'bold' ,
216
- 'color' : '#0000ff'
239
+ 'color' : '#0000ff' ,
240
+ 'position' : 'relative' ,
241
+ 'offset_top' : '10px' ,
242
+ 'decoration' : 'underline' ,
243
+ 'max_lines' : 2
217
244
}
218
245
self .assertEqual (
219
246
self .serialize_as_dict (arg , type = self .TEXT ),
0 commit comments