Implemented the TaskListView view and its respective view model in the app target.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import Foundation
|
||||
import SwiftData
|
||||
import Testing
|
||||
|
||||
@testable import Todos
|
||||
|
||||
@Suite("TaskList view model tests")
|
||||
struct TaskListViewModelTests {
|
||||
|
||||
// MARK: Computed tests
|
||||
|
||||
@Test(
|
||||
"navigationTitle returns correct title for each and every group",
|
||||
arguments: TodoGroup.allCases
|
||||
)
|
||||
func navigationTitle(for group: TodoGroup) {
|
||||
// GIVEN
|
||||
let viewModel = TaskListView.ViewModel(group: group)
|
||||
|
||||
// WHEN
|
||||
let title = viewModel.navigationTitle
|
||||
|
||||
// THEN
|
||||
#expect(title == group.title)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user