Skip to content

Commit

Permalink
fix test in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
SabrinaTardio committed May 7, 2024
1 parent d52c969 commit 123b604
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions DuckDuckGo/Common/Localizables/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ struct UserText {
static let mobileBookmarksImportedFolderTitle = NSLocalizedString("bookmarks.imported.mobile.folder.title", value: "Mobile bookmarks", comment: "Name of the \"Mobile bookmarks\" folder imported from other browser")

static let zoom = NSLocalizedString("zoom", value: "Zoom", comment: "Menu with Zooming commands")
static let resetZoom = NSLocalizedString("reset-zoom", value: "Reset", comment: "Button that allows the user to reset the zoom level of the browser page")

static let emailOptionsMenuItem = NSLocalizedString("email.optionsMenu", value: "Email Protection", comment: "Menu item email feature")
static let emailOptionsMenuCreateAddressSubItem = NSLocalizedString("email.optionsMenu.createAddress", value: "Generate Private Duck Address", comment: "Create an email alias sub menu item")
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/NavigationBar/View/ZoomPopover.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct ZoomPopoverContentView: View {
Button {
viewModel.reset()
} label: {
Text("Reset")
Text(UserText.resetZoom)
.frame(height: 28)
.padding(.horizontal, 8)
}
Expand Down
2 changes: 2 additions & 0 deletions UnitTests/Tab/ViewModel/ZoomPopoverViewModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ final class ZoomPopoverViewModelTests: XCTestCase {

@MainActor
func test_WhenResetZoomFromPopover_ThenWebViewIsReset() {
let expectation = self.expectation(forNotification: AccessibilityPreferences.zoomPerWebsiteUpdated, object: nil, handler: nil)

Check warning on line 73 in UnitTests/Tab/ViewModel/ZoomPopoverViewModelTests.swift

View workflow job for this annotation

GitHub Actions / Test (Sandbox)

initialization of immutable value 'expectation' was never used; consider replacing with assignment to '_' or removing it

Check warning on line 73 in UnitTests/Tab/ViewModel/ZoomPopoverViewModelTests.swift

View workflow job for this annotation

GitHub Actions / Test (Non-Sandbox)

initialization of immutable value 'expectation' was never used; consider replacing with assignment to '_' or removing it
let randomZoomLevel = DefaultZoomValue.allCases.randomElement()!
tabVM.tab.webView.defaultZoomValue = .percent100
tabVM.tab.webView.zoomLevel = randomZoomLevel

zoomPopover.reset()

waitForExpectations(timeout: 5)
XCTAssertEqual(.percent100, tabVM.tab.webView.zoomLevel)
XCTAssertEqual(.percent100, zoomPopover.zoomLevel)

Check failure on line 82 in UnitTests/Tab/ViewModel/ZoomPopoverViewModelTests.swift

View workflow job for this annotation

GitHub Actions / Test (Non-Sandbox)

test_WhenResetZoomFromPopover_ThenWebViewIsReset, XCTAssertEqual failed: ("percent100") is not equal to ("percent125")
}
Expand Down

0 comments on commit 123b604

Please sign in to comment.