UITests and Mock Screens

Adds the test targets for Unit and UI tests
Adds mock screen data and utilities to render each mock screen for previews/ui tests.
Changes Published property in the service to CurrentValueSubject. we don't need the synthesized aspect of Published and property wrappers cannot be included in protocols.
This commit is contained in:
David Langley
2021-09-09 16:23:00 +01:00
parent 760ba726ba
commit aa3cedbf9e
14 changed files with 306 additions and 37 deletions
@@ -45,6 +45,7 @@ struct TemplateUserProfile: View {
}
.frame(maxHeight: .infinity)
}
.background(theme.colors.background)
.frame(maxHeight: .infinity)
.navigationTitle(viewModel.viewState.displayName ?? "")
.navigationBarItems(leading: leftButton, trailing: rightButton)
@@ -70,7 +71,6 @@ struct TemplateUserProfile: View {
@available(iOS 14.0, *)
struct TemplateUserProfile_Previews: PreviewProvider {
static var previews: some View {
TemplateUserProfile(viewModel: TemplateUserProfileViewModel(userService: MockTemplateUserProfileService.example))
.addDependency(MockAvatarService.example)
MockTemplateProfileUserScreenStates.screenGroup()
}
}