@@ -37,6 +37,99 @@ internal final class SubtitleSpec: QuickSpec {
3737 expect ( Subtitle . rightAligned ( " text " ) . detailText) == . value1( " text " )
3838 expect ( Subtitle . leftAligned ( " text " ) . detailText) == . value2( " text " )
3939 }
40+
41+ context ( " NavigationRow " ) {
42+ let subtitle = Subtitle . belowTitle ( " detail text " )
43+ let detailText = DetailText . subtitle ( " detail text " )
44+ let icon = Icon . named ( " icon " )
45+
46+ var invoked = false
47+ let row = NavigationRow ( title: " text " , subtitle: subtitle, icon: icon, action: { _ in invoked = true } )
48+
49+ it ( " should support deprecated initializers " ) {
50+ expect ( row. text) == " text "
51+ expect ( row. detailText) == detailText
52+ expect ( row. icon) == icon
53+ expect ( row. cellReuseIdentifier) == " UITableViewCell.subtitle "
54+
55+ row. action ? ( row)
56+ expect ( invoked) == true
57+ }
58+
59+ it ( " should support deprecated properties " ) {
60+ expect ( row. title) == " text "
61+ expect ( row. subtitle? . text) == " detail text "
62+ }
63+ }
64+
65+ context ( " OptionRow " ) {
66+ let icon = Icon . named ( " icon " )
67+
68+ var invoked = false
69+ let row = OptionRow ( title: " text " , isSelected: true , icon: icon) { _ in invoked = true }
70+
71+ it ( " should support deprecated initializers " ) {
72+ // Row
73+ expect ( row. text) == " text "
74+ expect ( row. detailText) . to ( beNil ( ) )
75+ expect ( row. isSelected) == true
76+
77+ row. action ? ( row)
78+ expect ( invoked) == true
79+
80+ // RowStyle
81+ expect ( row. cellReuseIdentifier) == " UITableViewCell "
82+ expect ( row. cellStyle) == UITableViewCell . CellStyle. default
83+ expect ( row. icon) == icon
84+ expect ( row. accessoryType) == UITableViewCell . AccessoryType. checkmark
85+ expect ( row. isSelectable) == true
86+ expect ( row. customize) . to ( beNil ( ) )
87+ }
88+
89+ it ( " should support deprecated properties " ) {
90+ expect ( row. title) == " text "
91+ expect ( row. subtitle? . text) . to ( beNil ( ) )
92+ }
93+ }
94+
95+ context ( " SwitchRow " ) {
96+ var invoked = false
97+ let row = SwitchRow ( title: " text " , switchValue: true ) { _ in invoked = true }
98+
99+ it ( " should support deprecated initializers " ) {
100+ expect ( row. text) == " text "
101+ expect ( row. detailText) . to ( beNil ( ) )
102+ expect ( row. switchValue) == true
103+ expect ( row. cellReuseIdentifier) == " SwitchCell "
104+
105+ row. action ? ( row)
106+ expect ( invoked) == true
107+ }
108+
109+ it ( " should support deprecated properties " ) {
110+ expect ( row. title) == " text "
111+ expect ( row. subtitle? . text) . to ( beNil ( ) )
112+ }
113+ }
114+
115+ context ( " TapActionRow " ) {
116+ var invoked = false
117+ let row = TapActionRow ( title: " text " ) { _ in invoked = true }
118+
119+ it ( " should initialize with given parameters " ) {
120+ expect ( row. text) == " text "
121+ expect ( row. detailText) . to ( beNil ( ) )
122+ expect ( row. cellReuseIdentifier) == " TapActionCell "
123+
124+ row. action ? ( row)
125+ expect ( invoked) == true
126+ }
127+
128+ it ( " should support deprecated properties " ) {
129+ expect ( row. title) == " text "
130+ expect ( row. subtitle? . text) . to ( beNil ( ) )
131+ }
132+ }
40133 }
41134 }
42135
0 commit comments