Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SabrinaTardio committed May 8, 2024
1 parent c91f1ee commit 4d74971
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions UnitTests/Preferences/AccessibilityPreferencesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ class AccessibilityPreferencesTests: XCTestCase {
// WHEN
model.updateZoomPerWebsite(zoomLevel: zoom1, url: website1)
model.updateZoomPerWebsite(zoomLevel: zoom2, url: website2)
wait(for: [notificationExpectation], timeout: 5)

// THEN
XCTAssertEqual(model.zoomPerWebsite(url: website1), zoom1)
XCTAssertEqual(model.zoomPerWebsite(url: website2), zoom2)
XCTAssertEqual(persister.zoomPerWebsite[domain1], zoom1.rawValue)
XCTAssertEqual(persister.zoomPerWebsite[domain2], zoom2.rawValue)
wait(for: [notificationExpectation], timeout: 1)
}

func test_whenBurningZoomLevels_thenOnlyFireproofSiteZoomLevelAreRetained() {
Expand All @@ -108,6 +108,7 @@ class AccessibilityPreferencesTests: XCTestCase {

// WHEN
model.burnZoomLevels(except: fireProofDomains)
wait(for: [notificationExpectation], timeout: 5)

// THEN
XCTAssertEqual(model.zoomPerWebsite(url: website1), zoom1)

Check failure on line 114 in UnitTests/Preferences/AccessibilityPreferencesTests.swift

View workflow job for this annotation

GitHub Actions / Test (Non-Sandbox)

test_whenBurningZoomLevels_thenOnlyFireproofSiteZoomLevelAreRetained, XCTAssertEqual failed: ("nil") is not equal to ("Optional(DuckDuckGo_Privacy_Browser.DefaultZoomValue.percent100)")
Expand All @@ -118,7 +119,6 @@ class AccessibilityPreferencesTests: XCTestCase {
XCTAssertNil(persister.zoomPerWebsite[domain2])
XCTAssertEqual(persister.zoomPerWebsite[domain3], zoom3.rawValue)
XCTAssertNil(persister.zoomPerWebsite[domain4])
wait(for: [notificationExpectation], timeout: 1)
}

func test_whenBurningZoomLevelsPerSites_thenZoomLevelOfTheSiteIsNotRetained() {
Expand All @@ -134,6 +134,7 @@ class AccessibilityPreferencesTests: XCTestCase {

// WHEN
model.burnZoomLevel(of: [domain1, domain4])
wait(for: [notificationExpectation], timeout: 5)

// THEN
XCTAssertNil(model.zoomPerWebsite(url: website1))
Expand All @@ -144,7 +145,6 @@ class AccessibilityPreferencesTests: XCTestCase {
XCTAssertEqual(persister.zoomPerWebsite[domain2], zoom2.rawValue)
XCTAssertEqual(persister.zoomPerWebsite[domain3], zoom3.rawValue)
XCTAssertNil(persister.zoomPerWebsite[domain4])
wait(for: [notificationExpectation], timeout: 1)
}

}
Expand Down

0 comments on commit 4d74971

Please sign in to comment.