@@ -32,4 +32,74 @@ class ListTests: IgniteTestSuite {
3232
3333 #expect( output == " <ul><li>Veni</li><li>Vidi</li><li>Vici</li></ul> " )
3434 }
35+
36+ @Test ( " Ordered list uses ol tag " )
37+ func orderedList( ) async throws {
38+ let list = List {
39+ " First "
40+ " Second "
41+ } . listMarkerStyle ( . ordered)
42+ let output = list. markupString ( )
43+ #expect( output. hasPrefix ( " <ol " ) )
44+ #expect( output. hasSuffix ( " </ol> " ) )
45+ #expect( output. contains ( " First " ) )
46+ }
47+
48+ @Test ( " Group list style adds list-group class " )
49+ func groupListStyle( ) async throws {
50+ let list = List {
51+ " Item "
52+ } . listStyle ( . group)
53+ let output = list. markupString ( )
54+ #expect( output. contains ( " list-group " ) )
55+ #expect( output. contains ( " list-group-item " ) )
56+ }
57+
58+ @Test ( " Plain list style adds list-group-flush class " )
59+ func plainListStyle( ) async throws {
60+ let list = List {
61+ " Item "
62+ } . listStyle ( . plain)
63+ let output = list. markupString ( )
64+ #expect( output. contains ( " list-group-flush " ) )
65+ }
66+
67+ @Test ( " Horizontal group list style adds list-group-horizontal class " )
68+ func horizontalGroupListStyle( ) async throws {
69+ let list = List {
70+ " Item "
71+ } . listStyle ( . horizontalGroup)
72+ let output = list. markupString ( )
73+ #expect( output. contains ( " list-group-horizontal " ) )
74+ }
75+
76+ @Test ( " Custom marker style converts symbol to CSS unicode " )
77+ func customMarkerStyle( ) async throws {
78+ let list = List {
79+ " Starred "
80+ } . listMarkerStyle ( . custom( " ★ " ) )
81+ let output = list. markupString ( )
82+ #expect( output. contains ( " list-style-type " ) )
83+ }
84+
85+ @Test ( " Sequence initializer renders items from collection " )
86+ func sequenceInitializer( ) async throws {
87+ let names = [ " Alice " , " Bob " ]
88+ let list = List ( names) { name in
89+ Text ( name)
90+ }
91+ let output = list. markupString ( )
92+ #expect( output. contains ( " Alice " ) )
93+ #expect( output. contains ( " Bob " ) )
94+ }
95+
96+ @Test ( " Ordered list with specific marker style applies style " )
97+ func orderedListWithRomanMarker( ) async throws {
98+ let list = List {
99+ " Item "
100+ } . listMarkerStyle ( . ordered( . upperRoman) )
101+ let output = list. markupString ( )
102+ #expect( output. hasPrefix ( " <ol " ) )
103+ #expect( output. contains ( " list-style-type: upper-roman " ) )
104+ }
35105}
0 commit comments