-
Notifications
You must be signed in to change notification settings - Fork 25
chore: Tests compatible to iPad - WPB-20998 #3746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
444922b
672912b
8fc50f4
afa08ba
08653f7
d2151f2
b2cec8a
7621be6
98e1802
3e1f36a
77bea60
8a493dc
1cd717d
4cd87fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,9 +18,9 @@ | |
|
|
||
| import Foundation | ||
| import WireFoundation | ||
|
|
||
|
Check warning on line 21 in WireNetwork/Sources/WireNetwork/APIs/Rest/AuthenticationAPI/AuthenticationAPIV0.swift
|
||
| class AuthenticationAPIV0: AuthenticationAPI, VersionedAPI { | ||
|
|
||
|
Check warning on line 23 in WireNetwork/Sources/WireNetwork/APIs/Rest/AuthenticationAPI/AuthenticationAPIV0.swift
|
||
| let networkService: any NetworkServiceProtocol | ||
|
|
||
| init(networkService: any NetworkServiceProtocol) { | ||
|
|
@@ -213,8 +213,7 @@ | |
| let (data, response) = try await networkService.executeRequest(request) | ||
|
|
||
| guard | ||
| let responseURL = response.url, | ||
| let responseHeaders = response.allHeaderFields as? [String: String] | ||
| response.allHeaderFields is [String: String] | ||
netbe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| else { | ||
| throw AuthenticationAPIError.invalidResponse | ||
| } | ||
|
|
@@ -239,7 +238,7 @@ | |
| .withBody(body, contentType: .json) | ||
| .build() | ||
|
|
||
| let (data, response) = try await networkService.executeRequest(request) | ||
| let (_, response) = try await networkService.executeRequest(request) | ||
|
|
||
| guard | ||
| let responseURL = response.url, | ||
|
|
@@ -271,11 +270,12 @@ | |
| .withBody(body, contentType: .json) | ||
| .build() | ||
|
|
||
| let (data, response) = try await networkService.executeRequest(request) | ||
| let (_, response) = try await networkService.executeRequest(request) | ||
|
|
||
| try ResponseParser() | ||
| .success(code: .ok) | ||
| .failure(code: .badRequest, label: "bad-request", error: AuthenticationAPIError.invalidEmail) | ||
| .parse(code: response.statusCode, data: nil) | ||
| } | ||
|
|
||
| func requestEmailVerificationCode(for email: String) async throws { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,6 +219,7 @@ public struct SidebarView<AccountImageView: View, LegalHoldIndicatorView: View>: | |
| let icon: String | ||
| var iconHighlighted: String? | ||
| let accessibilityLabel: Text | ||
| var accessibilityIdentifier: String? | ||
| switch menuItem { | ||
| case .all: | ||
| text = Text(Strings.ConversationFilter.All.title) | ||
|
|
@@ -294,6 +295,7 @@ public struct SidebarView<AccountImageView: View, LegalHoldIndicatorView: View>: | |
| text = Text(Strings.Settings.title) | ||
| icon = "gearshape" | ||
| accessibilityLabel = Text(Labels.Settings.description) | ||
| accessibilityIdentifier = "bottomBarSettingsButton" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. todo: use locator instead
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will be updated accordingly once upcoming Locators.swift will be merged |
||
| } | ||
|
|
||
| return SidebarMenuItemView( | ||
|
|
@@ -306,6 +308,7 @@ public struct SidebarView<AccountImageView: View, LegalHoldIndicatorView: View>: | |
| accessibilityLabel: { accessibilityLabel }, | ||
| action: action | ||
| ) | ||
| .accessibilityIdentifier(accessibilityIdentifier ?? "") | ||
| } | ||
|
|
||
| public typealias AccountImageSource = SidebarAccountInfo.AccountImageSource | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,4 +35,11 @@ extension XCUIApplication { | |
| .enterPassword(password) | ||
| .acceptFirstTimeAlert() | ||
| } | ||
|
|
||
| @discardableResult | ||
| func iPadOnly(_ block: (() -> Void)? = nil) -> Bool { | ||
| guard UIDevice.current.userInterfaceIdiom == .pad else { return false } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw, checking userInterfaceIdiom is not future proof, since we might allow the iPad app to be resized. |
||
| block?() | ||
| return true | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: were these changes part of automatic linting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some warnings were flagging, tried resolving them.