- Explore filters by what a studyset's licence lets a learner do: adapt it (no NoDerivatives) and use it commercially (no NonCommercial), which the instance reads from the release's licence (ExploreQuery.adaptable, commercial) and the app the same way (LicenseUse). An instance from before ignores both. - While the studysets are read, the Library shows shimmering skeletons of their cards rather than a spinner: halkyon_ui's new Shimmer and SkeletonBox, still where the system asks for no animations. - The scope's "Include private studysets" is offered only while the person has a private studyset. - An agreement to what goes where is per provider (protocol and host): agreeing to one assistant agrees to every assistant of that provider, those granted later too, and the agreement sheet says so. No migration: it is written on every grant of the provider, so taking one back keeps it for the others, and read per provider from any of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
46 lines
1.5 KiB
Dart
46 lines
1.5 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
||
import 'package:halkyon_ui/halkyon_ui.dart';
|
||
import 'package:material_ui/material_ui.dart';
|
||
|
||
void main() {
|
||
Future<void> show(WidgetTester tester, {bool still = false}) =>
|
||
tester.pumpWidget(
|
||
MaterialApp(
|
||
theme: appTheme(Brightness.light),
|
||
home: MediaQuery(
|
||
data: MediaQueryData(disableAnimations: still),
|
||
child: const Scaffold(
|
||
body: Shimmer(
|
||
child: Column(
|
||
children: [
|
||
SkeletonBox(width: 120, height: 18),
|
||
SkeletonBox(height: 12),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
),
|
||
),
|
||
);
|
||
|
||
testWidgets('a skeleton stands where content will, in the theme’s '
|
||
'muted colour, a light band sweeping across it', (tester) async {
|
||
await show(tester);
|
||
|
||
expect(tester.getSize(find.byType(SkeletonBox).first), const Size(120, 18));
|
||
expect(find.byType(ShaderMask), findsOneWidget);
|
||
expect(tester.hasRunningAnimations, isTrue);
|
||
await tester.pump(const Duration(seconds: 1));
|
||
expect(tester.hasRunningAnimations, isTrue, reason: 'sweeping on');
|
||
});
|
||
|
||
testWidgets('it stands still where the system asks for no animations', (
|
||
tester,
|
||
) async {
|
||
await show(tester, still: true);
|
||
|
||
expect(find.byType(SkeletonBox), findsNWidgets(2));
|
||
expect(find.byType(ShaderMask), findsNothing);
|
||
expect(tester.hasRunningAnimations, isFalse);
|
||
});
|
||
}
|