forked from agentic-review-benchmarks/firefox-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSyncContentSettingsViewControllerTests.swift
More file actions
53 lines (47 loc) · 1.87 KB
/
SyncContentSettingsViewControllerTests.swift
File metadata and controls
53 lines (47 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/
@testable import Client
import XCTest
import Common
@MainActor
class SyncContentSettingsViewControllerTests: XCTestCase {
var profile: MockProfile!
var syncContentSettingsVC: SyncContentSettingsViewController?
let windowUUID: WindowUUID = .XCTestDefaultUUID
override func setUp() async throws {
try await super.setUp()
DependencyHelperMock().bootstrapDependencies()
profile = MockProfile()
LegacyFeatureFlagsManager.shared.initializeDeveloperFeatures(with: profile)
syncContentSettingsVC = SyncContentSettingsViewController(windowUUID: windowUUID)
syncContentSettingsVC?.profile = profile
}
override func tearDown() async throws {
DependencyHelperMock().reset()
profile = nil
syncContentSettingsVC = nil
try await super.tearDown()
}
func test_syncContentSettingsViewController_generateSettingsCount() {
let settingSections = syncContentSettingsVC?.generateSettings()
// Count should be 4 as the sections contains
// - manageSection [0]
// - enginesSection [1]
// - deviceNameSection [2]
// - disconnectSection [3]
XCTAssertEqual(settingSections?.count, 4)
}
func test_syncContentSettingsViewController_engineSectionForSettings() {
let settingSections = syncContentSettingsVC?.generateSettings()
let engineSectionChildren = settingSections?[1].children
// Count for engine section children should be 5
// as the sub engine section contains
// bookmarks
// history
// tabs
// passwords
// credit cards
XCTAssertEqual(engineSectionChildren?.count, 6)
}
}