mirror of
https://github.com/zhigang1992/GiphySearch.git
synced 2026-01-12 16:32:26 +08:00
switchToLatest so that the delayed trending code doesn't override the search
This commit is contained in:
@@ -32,7 +32,8 @@ class HomeViewModel {
|
||||
.switchLatest()
|
||||
|
||||
isSearching.asObservable()
|
||||
.flatMap({ $0 ? searching : trending })
|
||||
.map({ $0 ? searching : trending })
|
||||
.switchLatest()
|
||||
.subscribeNext({[unowned self] in
|
||||
self.giphys.value = $0
|
||||
})
|
||||
|
||||
@@ -31,6 +31,11 @@ class GiphySearchUITests: XCTestCase {
|
||||
func testExample() {
|
||||
// Use recording to get started writing UI tests.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
|
||||
let app = XCUIApplication()
|
||||
app.searchFields["Search"].tap()
|
||||
app.typeText("hello\r")
|
||||
app.buttons["Cancel"].tap()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user