mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Rename screens (#826)
* Rename: AnalyticsPrompt -> AnalyticsPromptScreen * Rename: AnalyticsSettings -> AnalyticsSettingsScreen * Rename: Settings -> SettingsScreen * Rename: SessionVerification -> SessionVerificationScreen * Rename: BugReport -> BugReportScreen * Rename: FilePreview -> FilePreviewScreen * Rename: AnalyticsPrompt -> AnalyticsPromptScreen * Rename: Invites -> InvitesScreen * Rename: InviteUsers -> InviteUsersScreen * Rename: MediaPicker -> MediaPickerScreen * Delete unused UIActivityViewControllerWrapper * Rename: ReportContent -> ReportContentScreen * Rename: RoomDetails -> RoomDetailsScreen * Rename: RoomMemberDetails -> RoomMemberDetailsScreen * Rename: RoomMemberList -> RoomMemberListScreen * Rename: Cleanup * Renaming missed items * Low effort attempt at fixing the flakey unit tests
This commit is contained in:
@@ -23,13 +23,13 @@ class BugReportViewModelTests: XCTestCase {
|
||||
enum TestError: Error {
|
||||
case testError
|
||||
}
|
||||
|
||||
|
||||
func testInitialState() {
|
||||
let viewModel = BugReportViewModel(bugReportService: BugReportServiceMock(),
|
||||
userID: "@mock.client.com",
|
||||
deviceID: nil,
|
||||
screenshot: nil,
|
||||
isModallyPresented: false)
|
||||
let viewModel = BugReportScreenViewModel(bugReportService: BugReportServiceMock(),
|
||||
userID: "@mock.client.com",
|
||||
deviceID: nil,
|
||||
screenshot: nil,
|
||||
isModallyPresented: false)
|
||||
let context = viewModel.context
|
||||
|
||||
XCTAssertEqual(context.reportText, "")
|
||||
@@ -38,11 +38,11 @@ class BugReportViewModelTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testClearScreenshot() async throws {
|
||||
let viewModel = BugReportViewModel(bugReportService: BugReportServiceMock(),
|
||||
userID: "@mock.client.com",
|
||||
deviceID: nil,
|
||||
screenshot: UIImage.actions,
|
||||
isModallyPresented: false)
|
||||
let viewModel = BugReportScreenViewModel(bugReportService: BugReportServiceMock(),
|
||||
userID: "@mock.client.com",
|
||||
deviceID: nil,
|
||||
screenshot: UIImage.actions,
|
||||
isModallyPresented: false)
|
||||
let context = viewModel.context
|
||||
|
||||
context.send(viewAction: .removeScreenshot)
|
||||
@@ -50,23 +50,23 @@ class BugReportViewModelTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testAttachScreenshot() async throws {
|
||||
let viewModel = BugReportViewModel(bugReportService: BugReportServiceMock(),
|
||||
userID: "@mock.client.com",
|
||||
deviceID: nil,
|
||||
screenshot: nil, isModallyPresented: false)
|
||||
let viewModel = BugReportScreenViewModel(bugReportService: BugReportServiceMock(),
|
||||
userID: "@mock.client.com",
|
||||
deviceID: nil,
|
||||
screenshot: nil, isModallyPresented: false)
|
||||
let context = viewModel.context
|
||||
XCTAssertNil(context.viewState.screenshot)
|
||||
context.send(viewAction: .attachScreenshot(UIImage.actions))
|
||||
XCTAssert(context.viewState.screenshot == UIImage.actions)
|
||||
}
|
||||
|
||||
|
||||
func testSendReportWithSuccess() async throws {
|
||||
let mockService = BugReportServiceMock()
|
||||
mockService.submitBugReportProgressListenerReturnValue = SubmitBugReportResponse(reportUrl: "https://test.test")
|
||||
let viewModel = BugReportViewModel(bugReportService: mockService,
|
||||
userID: "@mock.client.com",
|
||||
deviceID: nil,
|
||||
screenshot: nil, isModallyPresented: false)
|
||||
let viewModel = BugReportScreenViewModel(bugReportService: mockService,
|
||||
userID: "@mock.client.com",
|
||||
deviceID: nil,
|
||||
screenshot: nil, isModallyPresented: false)
|
||||
let context = viewModel.context
|
||||
context.send(viewAction: .submit)
|
||||
|
||||
@@ -89,10 +89,10 @@ class BugReportViewModelTests: XCTestCase {
|
||||
mockService.submitBugReportProgressListenerClosure = { _, _ in
|
||||
throw TestError.testError
|
||||
}
|
||||
let viewModel = BugReportViewModel(bugReportService: mockService,
|
||||
userID: "@mock.client.com",
|
||||
deviceID: nil,
|
||||
screenshot: nil, isModallyPresented: false)
|
||||
let viewModel = BugReportScreenViewModel(bugReportService: mockService,
|
||||
userID: "@mock.client.com",
|
||||
deviceID: nil,
|
||||
screenshot: nil, isModallyPresented: false)
|
||||
let context = viewModel.context
|
||||
context.send(viewAction: .submit)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user