production
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:miler/data/service_profile.dart';
|
||||
import 'package:miler/views/Dashboard/activity/activity_page.dart';
|
||||
import 'package:miler/views/helpers/constants/Colorconstants.dart';
|
||||
import 'package:miler/views/helpers/constants/narrative.dart';
|
||||
import 'package:miler/views/helpers/widgets/app_widgets.dart';
|
||||
import 'package:miler/data/accepted_store.dart';
|
||||
|
||||
@@ -127,46 +128,60 @@ void main() {
|
||||
// opens this screen for between stops is how his day is going, so that
|
||||
// is what the space says now.
|
||||
expect(find.text('Your recent delivery activity'), findsNothing);
|
||||
// The header is a figure now: the completed count as a numeral with
|
||||
// "delivered today" as its caption — the same treatment Home's head
|
||||
// uses, and the fixture's two finished stops are the number it shows.
|
||||
// ── The header is two figures now ──
|
||||
//
|
||||
// A count and a distance, given equal halves of the card with a hairline
|
||||
// between: what the shift produced and what it cost. `today` came off
|
||||
// both captions — the card is the day, and saying so twice inside it was
|
||||
// the word doing no work.
|
||||
expect(find.text('2'), findsOneWidget);
|
||||
expect(find.textContaining('today'), findsOneWidget);
|
||||
// The caption is the line's own completion verb — `picked up` on the
|
||||
// parcel profile the fixture runs, `delivered` on a meal round — so the
|
||||
// assertion is on the shape rather than on one line's word.
|
||||
expect(
|
||||
find.text(ServiceProfile.active.completionVerb.toLowerCase()),
|
||||
findsOneWidget,
|
||||
);
|
||||
|
||||
for (final f in const ['All', 'Active', 'Completed', 'Cancelled']) {
|
||||
expect(find.text(f), findsOneWidget, reason: '$f is missing');
|
||||
}
|
||||
});
|
||||
|
||||
testWidgets('the selected filter is a rule, not a chip', (tester) async {
|
||||
testWidgets('the selected filter is one travelling pill', (tester) async {
|
||||
await pump(tester, completed: [done('A1', 'Joe Mathew')]);
|
||||
|
||||
// ── This assertion moved down a level, deliberately ──
|
||||
// ── This assertion has moved three times, and the principle held ──
|
||||
//
|
||||
// It used to require exactly one *filled chip*, which was already the
|
||||
// quiet version: a bar where all four are outlined is four boxes
|
||||
// arguing about which one is on. But a filled pill is still a container,
|
||||
// and on a page whose brief is that containers recede it was the
|
||||
// loudest object above the list.
|
||||
// It began as "exactly one *filled chip*", against a bar where all four
|
||||
// were outlined — four boxes arguing about which one is on. It became "a
|
||||
// rule, not a chip" when the page's brief was that containers recede.
|
||||
// Then a segmented control, with the selected state a physical object
|
||||
// sliding along a track.
|
||||
//
|
||||
// What survives is the principle, one step further: the selected state
|
||||
// is carried by the brand colour on the word plus a 2pt rule under it,
|
||||
// and the unselected ones carry nothing at all.
|
||||
// The track is gone: it was a container drawn around a control that
|
||||
// already marks its own selection, and its equal slots forced every label
|
||||
// to the width of the longest. Four separate pills now, and the selected
|
||||
// one is filled brand with white type.
|
||||
//
|
||||
// The principle is the same one, stated a fourth time — **one** mark of
|
||||
// selection on the bar, never four.
|
||||
final selected = tester.widget<Text>(find.text('All'));
|
||||
expect(selected.style!.color, ColorConstants.primary);
|
||||
expect(selected.style!.color, Colors.white);
|
||||
expect(selected.style!.fontWeight, FontWeight.w700);
|
||||
|
||||
final other = tester.widget<Text>(find.text('Completed'));
|
||||
expect(other.style!.color, ColorConstants.secondaryText);
|
||||
expect(other.style!.color, Narrative.inkMuted);
|
||||
expect(other.style!.fontWeight, FontWeight.w600);
|
||||
|
||||
// One rule, on the selected word only.
|
||||
final rules = tester
|
||||
// Exactly one filled brand pill in the bar.
|
||||
final filled = tester
|
||||
.widgetList<AnimatedContainer>(find.byType(AnimatedContainer))
|
||||
.map((c) => c.decoration)
|
||||
.whereType<BoxDecoration>()
|
||||
.where((d) => d.color == ColorConstants.primary)
|
||||
.where((d) => d.color == Narrative.burgundy)
|
||||
.toList();
|
||||
expect(rules.length, 1);
|
||||
expect(filled, hasLength(1), reason: 'four selected filters is none');
|
||||
});
|
||||
|
||||
testWidgets('there is no chrome to operate on an empty day', (
|
||||
@@ -189,15 +204,22 @@ void main() {
|
||||
ServiceProfile.setActive(ServiceProfile.milkMan);
|
||||
await pump(tester, completed: [done('A1', 'Joe Mathew')]);
|
||||
|
||||
// The outcome word goes quiet for the norm: the rail disc beside the
|
||||
// row already carries "delivered" in shape and colour, and a day of 25
|
||||
// green words left no colour for the row that went wrong. The word only
|
||||
// wears the status ink when the status is the exception — pinned in
|
||||
// activity_row_test's parked-stop case.
|
||||
// ── The outcome is coloured again ──
|
||||
//
|
||||
// It went quiet when every row was drawn on the same white paper and
|
||||
// colour was the only thing separating them. The rows are cards now, so
|
||||
// the separation is structural, and the design brief makes emerald *the*
|
||||
// delivered state — a status the eye can pick out without reading is the
|
||||
// difference between scanning a day and reading one. The exception keeps
|
||||
// its own ink, pinned in activity_row_test's parked-stop case.
|
||||
final word = tester.widget<Text>(find.textContaining('Delivered'));
|
||||
expect(word.style!.color, ColorConstants.secondaryText);
|
||||
expect(word.style!.color, Narrative.emerald);
|
||||
|
||||
// The rider knows a stop by who was at the door, so the name leads.
|
||||
// w600 — the brief's `title-lg`, which is what a card's own heading is
|
||||
// set at. It briefly ran at w700 while the cards had no border and no
|
||||
// lift to rank them; with both, the weight does not have to do that job
|
||||
// as well.
|
||||
final name = tester.widget<Text>(find.text('Joe Mathew'));
|
||||
expect(name.style!.fontWeight, FontWeight.w600);
|
||||
expect(
|
||||
@@ -219,7 +241,11 @@ void main() {
|
||||
expect(find.text('#A1'), findsNothing);
|
||||
|
||||
// The measurements are running text, not columns and not chips.
|
||||
//
|
||||
// One match. The hero's half prints the bare figure with `km ridden` as
|
||||
// its caption, so the only `3.2 km` on the page is this row's own.
|
||||
expect(find.text('3.2 km'), findsOneWidget);
|
||||
expect(find.text('km ridden'), findsOneWidget);
|
||||
expect(find.text('28m'), findsOneWidget);
|
||||
|
||||
// The address is detail for one stop; it belongs in the record.
|
||||
|
||||
Reference in New Issue
Block a user