wayBetter for X
This commit is contained in:
commit
434f193217
720 changed files with 147465 additions and 0 deletions
20
apps/desktop/tests/fabPlacement.test.ts
Normal file
20
apps/desktop/tests/fabPlacement.test.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { FAB_GAP, fabBottom, fabHidden } from '../src/inject/fabPlacement.ts';
|
||||
|
||||
test('wayBetter button: hidden on X photo/video viewer routes and while X shows an overlay', () => {
|
||||
for (const path of ['/CRTkafa/status/2104386004480340154/photo/1', '/jack/status/20/video/1', '/jack/status/20/photo/4/']) {
|
||||
assert.equal(fabHidden(path, false), true, path);
|
||||
}
|
||||
for (const path of ['/home', '/jack/status/20', '/jack/photo', '/i/flow/login', '/jack/media']) {
|
||||
assert.equal(fabHidden(path, false), false, path);
|
||||
}
|
||||
assert.equal(fabHidden('/home', true), true);
|
||||
});
|
||||
|
||||
test('wayBetter button: sits above X bottom bar, ignores the empty desktop bar', () => {
|
||||
assert.equal(fabBottom(null, 812), FAB_GAP);
|
||||
assert.equal(fabBottom(812, 812), FAB_GAP, 'zero-height bar at the bottom edge');
|
||||
assert.equal(fabBottom(759, 812), 53 + FAB_GAP, 'mobile layout bottom bar');
|
||||
assert.equal(fabBottom(100, 812), FAB_GAP, 'not a bottom bar');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue