feat: Introduce category selection functionality in NoteEditorScreen and related components
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:notas/models/note.dart';
|
||||
|
||||
void main() {
|
||||
test('copyWith can clear categoryId explicitly', () {
|
||||
final Note note = Note(
|
||||
title: 'A',
|
||||
body: 'B',
|
||||
createdAt: DateTime(2026, 5, 21),
|
||||
updatedAt: DateTime(2026, 5, 21),
|
||||
position: 0,
|
||||
categoryId: 'cat-1',
|
||||
);
|
||||
|
||||
final Note cleared = note.copyWith(categoryId: null);
|
||||
|
||||
expect(cleared.categoryId, isNull);
|
||||
expect(cleared.id, note.id);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user