mirror of
https://github.com/metabolist/metatext.git
synced 2024-06-03 14:09:25 +00:00
25 lines
756 B
Swift
25 lines
756 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import XCTest
|
|
import Combine
|
|
import CombineExpectations
|
|
@testable import Metatext
|
|
|
|
class SceneViewModelTests: XCTestCase {
|
|
func testAddIdentity() throws {
|
|
let sut = SceneViewModel(networkClient: .fresh(), environment: .fresh())
|
|
let identityRecorder = sut.$identity.record()
|
|
|
|
XCTAssertNil(try wait(for: identityRecorder.next(), timeout: 1))
|
|
|
|
let addIdentityViewModel = sut.addIdentityViewModel()
|
|
|
|
addIdentityViewModel.urlFieldText = "https://mastodon.social"
|
|
addIdentityViewModel.goTapped()
|
|
|
|
let identity = try wait(for: identityRecorder.next(), timeout: 1)!
|
|
|
|
XCTAssertEqual(identity.id, addIdentityViewModel.addedIdentityID)
|
|
}
|
|
}
|