Integrated the NewTask view into the Content view in. the app target.

This commit is contained in:
2026-02-09 18:51:05 +01:00
parent 1ec6aa5297
commit 80e5e8a8f6
3 changed files with 110 additions and 46 deletions
@@ -0,0 +1,36 @@
import Foundation
import SwiftData
import Testing
@testable import Todos
@Suite("ContentView.ViewModel Tests")
struct ContentViewModelTests {
// MARK: Initialization Tests
@Test("View model initializes with default values")
func initialization() {
// GIVEN
// WHEN
let viewModel = ContentView.ViewModel()
// THEN
#expect(viewModel.newTaskShown == false)
}
// MARK: - Functions Tests
@Test("showNewTask sets showNewTaskView to true")
func newTaskShown() {
// GIVEN
let viewModel = ContentView.ViewModel()
// WHEN
viewModel.showNewTask()
// THEN
#expect(viewModel.newTaskShown == true)
}
}