Skip to content

Commit 7e25296

Browse files
committed
Fix tests
1 parent 685ab36 commit 7e25296

File tree

2 files changed

+8
-136
lines changed

2 files changed

+8
-136
lines changed

ios/Tests/GutenbergKitTests/EditorConfigurationBuilderTests.swift

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ struct EditorConfigurationBuilderTests {
2020
#expect(builder.siteApiNamespace == [])
2121
#expect(builder.namespaceExcludedPaths == [])
2222
#expect(builder.authHeader == "")
23-
#expect(builder.webViewGlobals == [])
24-
#expect(builder.editorSettings.isEmpty)
23+
#expect(builder.editorSettings == "undefined")
2524
#expect(builder.locale == "en")
2625
#expect(builder.editorAssetsEndpoint == nil)
2726
}
2827

2928
@Test("Editor Configuration to Builder")
3029
func testThatEditorConfigurationToBuilder() throws {
31-
let configuration = try EditorConfigurationBuilder()
30+
let configuration = EditorConfigurationBuilder()
3231
.setTitle("Title")
3332
.setContent("Content")
3433
.setPostID(123)
@@ -41,8 +40,7 @@ struct EditorConfigurationBuilderTests {
4140
.setSiteApiNamespace(["wp", "v2"])
4241
.setNamespaceExcludedPaths(["jetpack"])
4342
.setAuthHeader("Bearer Token")
44-
.setWebViewGlobals([WebViewGlobal(name: "foo", value: .string("bar"))])
45-
.setEditorSettings(["foo":"bar"])
43+
.setEditorSettings(#"{"foo":"bar"}"#)
4644
.setLocale("fr")
4745
.setEditorAssetsEndpoint(URL(string: "https://example.com/wp-content/plugins/gutenberg/build/"))
4846
.build() // Convert to a configuration
@@ -61,8 +59,7 @@ struct EditorConfigurationBuilderTests {
6159
#expect(configuration.siteApiNamespace == ["wp", "v2"])
6260
#expect(configuration.namespaceExcludedPaths == ["jetpack"])
6361
#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"}"#)
6663
#expect(configuration.locale == "fr")
6764
#expect(configuration.editorAssetsEndpoint == URL(string: "https://example.com/wp-content/plugins/gutenberg/build/"))
6865
}
@@ -138,25 +135,15 @@ struct EditorConfigurationBuilderTests {
138135
#expect(EditorConfigurationBuilder().setAuthHeader("Bearer token").build().authHeader == "Bearer token")
139136
}
140137

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-
152138
@Test("Sets editorSettings Correctly")
153139
func editorConfigurationBuilderSetsEditorSettingsCorrectly() throws {
140+
let json = #"{"foo":"bar"}"#
154141
#expect(
155142
EditorConfigurationBuilder()
156-
.setEditorSettings(["foo": "bar"])
143+
.setEditorSettings(json)
157144
.build()
158-
.editorSettingsJSON
159-
== "{\"foo\":\"bar\"}"
145+
.editorSettings
146+
== json
160147
)
161148
}
162149

ios/Tests/GutenbergKitTests/EditorConfigurationTests.swift

Lines changed: 0 additions & 115 deletions
This file was deleted.

0 commit comments

Comments
 (0)