21 lines
498 B
Dart
21 lines
498 B
Dart
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);
|
|
});
|
|
} |