@@ -20,15 +20,14 @@ struct EditorConfigurationBuilderTests {
20
20
#expect( builder. siteApiNamespace == [ ] )
21
21
#expect( builder. namespaceExcludedPaths == [ ] )
22
22
#expect( builder. authHeader == " " )
23
- #expect( builder. webViewGlobals == [ ] )
24
- #expect( builder. editorSettings. isEmpty)
23
+ #expect( builder. editorSettings == " undefined " )
25
24
#expect( builder. locale == " en " )
26
25
#expect( builder. editorAssetsEndpoint == nil )
27
26
}
28
27
29
28
@Test ( " Editor Configuration to Builder " )
30
29
func testThatEditorConfigurationToBuilder( ) throws {
31
- let configuration = try EditorConfigurationBuilder ( )
30
+ let configuration = EditorConfigurationBuilder ( )
32
31
. setTitle ( " Title " )
33
32
. setContent ( " Content " )
34
33
. setPostID ( 123 )
@@ -41,8 +40,7 @@ struct EditorConfigurationBuilderTests {
41
40
. setSiteApiNamespace ( [ " wp " , " v2 " ] )
42
41
. setNamespaceExcludedPaths ( [ " jetpack " ] )
43
42
. setAuthHeader ( " Bearer Token " )
44
- . setWebViewGlobals ( [ WebViewGlobal ( name: " foo " , value: . string( " bar " ) ) ] )
45
- . setEditorSettings ( [ " foo " : " bar " ] )
43
+ . setEditorSettings ( #"{"foo":"bar"}"# )
46
44
. setLocale ( " fr " )
47
45
. setEditorAssetsEndpoint ( URL ( string: " https://example.com/wp-content/plugins/gutenberg/build/ " ) )
48
46
. build ( ) // Convert to a configuration
@@ -61,8 +59,7 @@ struct EditorConfigurationBuilderTests {
61
59
#expect( configuration. siteApiNamespace == [ " wp " , " v2 " ] )
62
60
#expect( configuration. namespaceExcludedPaths == [ " jetpack " ] )
63
61
#expect( configuration. authHeader == " Bearer Token " )
64
- #expect( configuration. webViewGlobals == [ try WebViewGlobal ( name: " foo " , value: . string( " bar " ) ) ] )
65
- #expect( configuration. editorSettingsJSON == #"{"foo":"bar"}"# )
62
+ #expect( configuration. editorSettings == #"{"foo":"bar"}"# )
66
63
#expect( configuration. locale == " fr " )
67
64
#expect( configuration. editorAssetsEndpoint == URL ( string: " https://example.com/wp-content/plugins/gutenberg/build/ " ) )
68
65
}
@@ -138,25 +135,15 @@ struct EditorConfigurationBuilderTests {
138
135
#expect( EditorConfigurationBuilder ( ) . setAuthHeader ( " Bearer token " ) . build ( ) . authHeader == " Bearer token " )
139
136
}
140
137
141
- @Test ( " Sets webViewGlobals Correctly " )
142
- func editorConfigurationBuilderSetsWebViewGlobalsCorrectly( ) throws {
143
- #expect(
144
- try EditorConfigurationBuilder ( )
145
- . setWebViewGlobals ( [ WebViewGlobal ( name: " foo " , value: . string( " bar " ) ) ] )
146
- . build ( )
147
- . webViewGlobals
148
- == [ WebViewGlobal ( name: " foo " , value: . string( " bar " ) ) ]
149
- )
150
- }
151
-
152
138
@Test ( " Sets editorSettings Correctly " )
153
139
func editorConfigurationBuilderSetsEditorSettingsCorrectly( ) throws {
140
+ let json = #"{"foo":"bar"}"#
154
141
#expect(
155
142
EditorConfigurationBuilder ( )
156
- . setEditorSettings ( [ " foo " : " bar " ] )
143
+ . setEditorSettings ( json )
157
144
. build ( )
158
- . editorSettingsJSON
159
- == " { \" foo \" : \" bar \" } "
145
+ . editorSettings
146
+ == json
160
147
)
161
148
}
162
149
0 commit comments