This PR contains the work done to implement the **List Tasks** feature, and to integrate it into the main content view of the app. Reviewed-on: rock-n-code/todos-app#4 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
28 lines
556 B
Swift
28 lines
556 B
Swift
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)
|
|
}
|
|
|
|
}
|