File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
ios/Tests/GutenbergKitTests Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -156,4 +156,19 @@ struct EditorConfigurationBuilderTests {
156156 func editorConfigurationBuilderSetsEditorAssetsEndpointCorrectly( ) throws {
157157 #expect( EditorConfigurationBuilder ( ) . setEditorAssetsEndpoint ( URL ( string: " https://example.com/wp-content/plugins/gutenberg/build/ " ) ) . build ( ) . editorAssetsEndpoint == URL ( string: " https://example.com/wp-content/plugins/gutenberg/build/ " ) )
158158 }
159+
160+ @Test ( " Applies values correctly " )
161+ func editorConfigurationBuilderAppliesValuesCorrectly( ) throws {
162+ let string = " test "
163+ let nilString : String ? = nil
164+
165+ let int = 1
166+ let nilInt : Int ? = nil
167+
168+ #expect( EditorConfigurationBuilder ( ) . apply ( string, { $0. setTitle ( $1) } ) . build ( ) . title == string)
169+ #expect( EditorConfigurationBuilder ( ) . apply ( nilString, { $0. setTitle ( $1) } ) . build ( ) . title == " " )
170+
171+ #expect( EditorConfigurationBuilder ( ) . apply ( int, { $0. setPostID ( $1) } ) . build ( ) . postID == int)
172+ #expect( EditorConfigurationBuilder ( ) . apply ( nilInt, { $0. setPostID ( $1) } ) . build ( ) . postID == nil )
173+ }
159174}
You can’t perform that action at this time.
0 commit comments