feat: add two-tab timetable UI and glass dock
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:timezone/data/latest.dart' as tzdata;
|
||||
import 'package:hepan_everyday/features/timetable/week_grid.dart';
|
||||
import 'package:hepan_everyday/domain/schedule_engine.dart';
|
||||
import 'package:hepan_everyday/domain/app_settings.dart';
|
||||
|
||||
void main() {
|
||||
setUpAll(tzdata.initializeTimeZones);
|
||||
testWidgets('transitive lesson conflicts never cover another course card', (
|
||||
tester,
|
||||
) async {
|
||||
final term = Semester(startDate: DateTime(2026, 9, 7), totalWeeks: 1);
|
||||
Course c(String name, int first, int last) => Course(
|
||||
id: name,
|
||||
name: name,
|
||||
teacher: 'T',
|
||||
room: 'R',
|
||||
weekday: 1,
|
||||
startPeriod: first,
|
||||
endPeriod: last,
|
||||
weeks: {1},
|
||||
source: CourseSource.file,
|
||||
);
|
||||
final events = ScheduleEngine.occurrences([
|
||||
c('A', 1, 2),
|
||||
c('B', 2, 3),
|
||||
c('C', 3, 4),
|
||||
], term);
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: SingleChildScrollView(
|
||||
child: WeekGrid(
|
||||
events: events,
|
||||
monday: term.firstMonday,
|
||||
today: term.startDate,
|
||||
settings: const AppSettings(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
final a = tester.getRect(find.bySemanticsLabel('A,T,R'));
|
||||
final b = tester.getRect(find.bySemanticsLabel('B,T,R'));
|
||||
final cRect = tester.getRect(find.bySemanticsLabel('C,T,R'));
|
||||
expect(a.right, lessThanOrEqualTo(b.left));
|
||||
expect(b.right, lessThanOrEqualTo(cRect.left));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user