Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix displaying course name when editing homework. #1121

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/lib/blocs/homework/homework_dialog_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class HomeworkDialogBloc extends BlocBase with HomeworkValidators {

final c = Course.create().copyWith(
subject: homework.subject,
name: homework.subject,
name: homework.courseName,
sharecode: "000000",
abbreviation: homework.subjectAbbreviation,
id: homework.courseReference!.id,
Expand Down
11 changes: 2 additions & 9 deletions app/test/homework/homework_dialog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,7 @@ void main() {

expect(userInput.title, 'New title text');
expect(userInput.course!.id, 'foo_course');
// The following TestFailure was thrown running a test:
// Expected: 'Foo course'
// Actual: 'Foo subject'
// Which: is different.
// Expected: Foo course
// Actual: Foo subject
// ^
// expect(userInput.course!.name, 'Foo course');
expect(userInput.course!.name, 'Foo course');
expect(userInput.course!.subject, 'Foo subject');
// The following TestFailure was thrown running a test:
// Expected: 'F'
Expand Down Expand Up @@ -379,7 +372,7 @@ void main() {
await pumpAndSettleHomeworkDialog(tester);

expect(find.text('title text', findRichText: true), findsOneWidget);
expect(find.text('Foo subject'), findsOneWidget);
expect(find.text('Foo course'), findsOneWidget);
// Not found, idk why:
// expect(find.text('12. März 2024'), findsOneWidget);
expect(find.text('Mit Abgabe'), findsOneWidget);
Expand Down