@@ -1161,6 +1161,39 @@ class EditorSnapshotTests: SnapshotTestCase {
1161
1161
assertSnapshot ( matching: viewController. view, as: . image, record: recordMode)
1162
1162
}
1163
1163
1164
+ func testWrappedBackgroundInNestedEditor( ) {
1165
+ let viewController = EditorTestViewController ( )
1166
+ let editor = viewController. editor
1167
+ let config = GridConfiguration (
1168
+ columnsConfiguration: [
1169
+ GridColumnConfiguration ( width: . fixed( 60 ) ) ,
1170
+ GridColumnConfiguration ( width: . fractional( 0.30 ) ) ,
1171
+ GridColumnConfiguration ( width: . fractional( 0.30 ) ) ,
1172
+ ] ,
1173
+ rowsConfiguration: [
1174
+ GridRowConfiguration ( initialHeight: 40 ) ,
1175
+ GridRowConfiguration ( initialHeight: 40 ) ,
1176
+ ] )
1177
+ let attachment = GridViewAttachment ( config: config)
1178
+
1179
+ editor. insertAttachment ( in: editor. textEndRange, attachment: attachment)
1180
+
1181
+ XCTAssertEqual ( attachment. view. containerAttachment, attachment)
1182
+
1183
+ viewController. render ( size: CGSize ( width: 300 , height: 225 ) )
1184
+
1185
+ let backgroundStyle = BackgroundStyle ( color: . red,
1186
+ roundedCornerStyle: . absolute( value: 6 ) ,
1187
+ border: BorderStyle ( lineWidth: 1 , color: . yellow) ,
1188
+ shadow: ShadowStyle ( color: . blue, offset: CGSize ( width: 2 , height: 2 ) , blur: 2 ) ,
1189
+ widthMode: . matchTextExact)
1190
+
1191
+ let cell01 = attachment. view. cellAt ( rowIndex: 0 , columnIndex: 1 )
1192
+ cell01? . editor. attributedText = NSAttributedString ( string: " testLongString ThatWrapsToMultiple Lines " , attributes: [ . backgroundStyle: backgroundStyle, . textBlock: 1 ] )
1193
+
1194
+ assertSnapshot ( matching: viewController. view, as: . image, record: recordMode)
1195
+ }
1196
+
1164
1197
func testEditorWithArabicText( ) {
1165
1198
let viewController = EditorTestViewController ( )
1166
1199
let editor = viewController. editor
0 commit comments