Skip to content

Commit 338b94a

Browse files
authored
Merge pull request #7749 from woocommerce/fix/modify-fakes-due-renaming
Add `fake()` method to DotcomUser and JetpackUser entities
2 parents 2f631e9 + 7a2f687 commit 338b94a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Fakes/Fakes/Networking.generated.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,19 @@ extension DotcomError {
188188
.empty
189189
}
190190
}
191+
extension DotcomUser {
192+
/// Returns a "ready to use" type filled with fake values.
193+
///
194+
public static func fake() -> DotcomUser {
195+
.init(
196+
id: .fake(),
197+
username: .fake(),
198+
email: .fake(),
199+
displayName: .fake(),
200+
avatar: .fake()
201+
)
202+
}
203+
}
191204
extension InboxAction {
192205
/// Returns a "ready to use" type filled with fake values.
193206
///
@@ -220,6 +233,19 @@ extension InboxNote {
220233
)
221234
}
222235
}
236+
extension JetpackUser {
237+
/// Returns a "ready to use" type filled with fake values.
238+
///
239+
public static func fake() -> JetpackUser {
240+
.init(
241+
isConnected: .fake(),
242+
isPrimary: .fake(),
243+
username: .fake(),
244+
wpcomUser: .fake(),
245+
gravatar: .fake()
246+
)
247+
}
248+
}
223249
extension Leaderboard {
224250
/// Returns a "ready to use" type filled with fake values.
225251
///

0 commit comments

Comments
 (0)