mirror of
https://github.com/bitwarden/ios.git
synced 2026-04-13 01:13:26 -05:00
18 lines
533 B
Swift
18 lines
533 B
Swift
import Testing
|
|
|
|
@testable import BitwardenShared
|
|
|
|
class LoadingStateTests {
|
|
// MARK: Tests
|
|
|
|
/// `isLoading` returns `true` when the state is `.loading` or `false` otherwise.
|
|
@Test
|
|
func isLoading() {
|
|
#expect(LoadingState<String>.loading(nil).isLoading == true)
|
|
#expect(LoadingState<String>.loading("test").isLoading == true)
|
|
|
|
#expect(LoadingState<String>.error(errorMessage: "An error occurred").isLoading == false)
|
|
#expect(LoadingState<String>.data("Data").isLoading == false)
|
|
}
|
|
}
|