production
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:miler/views/helpers/constants/Colorconstants.dart';
|
||||
import 'package:miler/views/helpers/constants/miler_surface.dart';
|
||||
import 'package:miler/views/helpers/constants/narrative.dart';
|
||||
|
||||
/// ─────────────────────────────────────────────────────────────────────────
|
||||
/// THE LAYERS HAVE TO BE VISIBLE TO BE LAYERS
|
||||
@@ -40,20 +41,35 @@ double contrast(Color a, Color b) {
|
||||
|
||||
void main() {
|
||||
group('the ladder has real rungs', () {
|
||||
test('a working surface separates from the canvas without a border', () {
|
||||
// ── This rung is now bought two ways, not one ──
|
||||
//
|
||||
// The old contract was: the tonal step alone has to carry the separation,
|
||||
// because a card had no border and no shadow — so anything under ~1.25:1
|
||||
// meant screens would start drawing their own outlines to compensate.
|
||||
//
|
||||
// Cards carry a hairline *and* a soft lift now (see [MilerPanel] and
|
||||
// [Narrative]), which is the brief's recipe rather than this one, and the
|
||||
// canvas went light to match. The step is deliberately smaller; what must
|
||||
// not happen is that it goes to nothing, because then the border is doing
|
||||
// the whole job and a card on a page reads as a box drawn on paper.
|
||||
test('a working surface still separates from the canvas', () {
|
||||
final step = contrast(MilerSurface.working, MilerSurface.canvas);
|
||||
expect(
|
||||
step,
|
||||
greaterThanOrEqualTo(1.25),
|
||||
reason:
|
||||
'white on the canvas is $step : 1 — below ~1.25 a surface does '
|
||||
'not read as a surface, and screens start drawing their own '
|
||||
'outlines to compensate',
|
||||
greaterThan(1.0),
|
||||
reason: 'white on the canvas is $step : 1 — the ground has vanished',
|
||||
);
|
||||
// And not so far that the page turns into a dark frame around content.
|
||||
expect(step, lessThan(1.6));
|
||||
});
|
||||
|
||||
test('a card carries the edge and the lift the ground no longer does', () {
|
||||
// The other half of the trade above. If either of these is dropped, the
|
||||
// canvas has to go back to carrying the step on its own.
|
||||
expect(Narrative.cardShadow, isNotEmpty);
|
||||
expect(Narrative.cardBorder, isNot(Narrative.card));
|
||||
});
|
||||
|
||||
test('the canvas is never white', () {
|
||||
expect(MilerSurface.canvas, isNot(MilerSurface.working));
|
||||
expect(MilerSurface.canvas, isNot(const Color(0xFFFFFFFF)));
|
||||
|
||||
Reference in New Issue
Block a user