Revision control

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
import XCTest
6
@testable import Client
7
8
class VersionSettingTests: XCTestCase {
9
10
func testCopyAppVersion() {
11
// MARK: - given
12
let settingsTable = SettingsTableViewController(style: .grouped)
13
let navigationController = UINavigationController(rootViewController: settingsTable)
14
let versionSetting = VersionSetting(settings: settingsTable)
15
16
// MARK: - when
17
versionSetting.onLongPress(navigationController)
18
19
// MARK: - then
20
let appVersionString = UIPasteboard.general.string
21
let appVersionPredicate = (appVersionString?.contains("Version") ?? false) == true
22
XCTAssertNotNil(appVersionString, "App version doesn't be copying")
23
XCTAssert(appVersionPredicate, "Pasteboard doesn't contains app version")
24
}
25
26
}