Integrated the NewTask view into the Content view in. the app target.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user