List tasks feature (#4)
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>
This commit was merged in pull request #4.
This commit is contained in:
@@ -124,10 +124,7 @@ struct NewTaskViewModelTests {
|
||||
@MainActor
|
||||
func saveWithAllProperties() throws {
|
||||
// GIVEN
|
||||
let container = try ModelContainer(
|
||||
for: Todo.self,
|
||||
configurations: .init(isStoredInMemoryOnly: true)
|
||||
)
|
||||
let container = try modelContainer
|
||||
let context = container.mainContext
|
||||
let viewModel = NewTaskView.ViewModel()
|
||||
|
||||
@@ -153,10 +150,7 @@ struct NewTaskViewModelTests {
|
||||
@MainActor
|
||||
func saveWithEmptyNote() throws {
|
||||
// GIVEN
|
||||
let container = try ModelContainer(
|
||||
for: Todo.self,
|
||||
configurations: .init(isStoredInMemoryOnly: true)
|
||||
)
|
||||
let container = try modelContainer
|
||||
let context = container.mainContext
|
||||
let viewModel = NewTaskView.ViewModel()
|
||||
|
||||
@@ -182,10 +176,7 @@ struct NewTaskViewModelTests {
|
||||
@MainActor
|
||||
func saveWithWhitespaceNote() throws {
|
||||
// GIVEN
|
||||
let container = try ModelContainer(
|
||||
for: Todo.self,
|
||||
configurations: .init(isStoredInMemoryOnly: true)
|
||||
)
|
||||
let container = try modelContainer
|
||||
let context = container.mainContext
|
||||
let viewModel = NewTaskView.ViewModel()
|
||||
|
||||
@@ -211,10 +202,7 @@ struct NewTaskViewModelTests {
|
||||
@MainActor
|
||||
func saveMultipleTodos() throws {
|
||||
// GIVEN
|
||||
let container = try ModelContainer(
|
||||
for: Todo.self,
|
||||
configurations: .init(isStoredInMemoryOnly: true)
|
||||
)
|
||||
let container = try modelContainer
|
||||
let context = container.mainContext
|
||||
let viewModelFirst = NewTaskView.ViewModel()
|
||||
let viewModelSecond = NewTaskView.ViewModel()
|
||||
@@ -237,3 +225,20 @@ struct NewTaskViewModelTests {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Helpers
|
||||
|
||||
private extension NewTaskViewModelTests {
|
||||
|
||||
// MARK: Computed
|
||||
|
||||
var modelContainer: ModelContainer {
|
||||
get throws {
|
||||
try ModelContainer(
|
||||
for: Todo.self,
|
||||
configurations: .init(isStoredInMemoryOnly: true)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user