feat(ui): restyle core views with Material You
This commit is contained in:
29
src/features/theme/services/MaterialYouVisualTokens.test.ts
Normal file
29
src/features/theme/services/MaterialYouVisualTokens.test.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import assert from 'node:assert/strict';
|
||||
import { describe, it } from 'node:test';
|
||||
import {
|
||||
isDynamicColorResultCurrent,
|
||||
MATERIAL_YOU_VISUALS,
|
||||
} from '@/features/theme/services/MaterialYouVisualTokens.ts';
|
||||
|
||||
describe('Material You visual tokens', () => {
|
||||
it('defines lifted cards and low-distraction reader chrome', () => {
|
||||
assert.equal(MATERIAL_YOU_VISUALS.cardRadius, 20);
|
||||
assert.equal(MATERIAL_YOU_VISUALS.cardHoverLift, -4);
|
||||
assert.equal(MATERIAL_YOU_VISUALS.detailRadius, 24);
|
||||
assert.equal(MATERIAL_YOU_VISUALS.readerChromeOpacity, 0.92);
|
||||
});
|
||||
|
||||
it('rejects stale or aborted dynamic-color work', () => {
|
||||
assert.equal(isDynamicColorResultCurrent('/cover/1', '/cover/1', false), true);
|
||||
assert.equal(isDynamicColorResultCurrent('/cover/1', '/cover/2', false), false);
|
||||
assert.equal(isDynamicColorResultCurrent('/cover/1', '/cover/1', true), false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user