[docs] KeepHerSafeApps: Round trip on the tablet, the page between Android's bars, review, gaps closed, lessons
This commit is contained in:
@@ -50,6 +50,17 @@ describe('the Android save bridge', () => {
|
||||
expect(kotlin).toMatch(/@JavascriptInterface\s+fun save\(name: String, text: String\)/);
|
||||
});
|
||||
|
||||
it("paints behind the system bars with the garden's own paper, light and dark", () => {
|
||||
const tokens = readFileSync(join(HERE, '..', '..', '..', 'packages', 'ui', 'src', 'tokens.css'), 'utf8');
|
||||
const papers = [...tokens.matchAll(/--paper:\s*(#[0-9a-f]{6})/gi)].map((m) => m[1]!.toLowerCase());
|
||||
expect(papers).toHaveLength(2);
|
||||
expect(/PAPER = "(#[0-9a-f]{6})"/i.exec(kotlin)?.[1]?.toLowerCase()).toBe(papers[0]);
|
||||
expect(/PAPER_DARK = "(#[0-9a-f]{6})"/i.exec(kotlin)?.[1]?.toLowerCase()).toBe(papers[1]);
|
||||
// A source check only; the proof is the tablet's screenshot (review). Exact call and padding:
|
||||
expect(kotlin).toMatch(/ViewCompat\.setOnApplyWindowInsetsListener\(findViewById\(android\.R\.id\.content\)\)/);
|
||||
expect(kotlin).toMatch(/view\.setPadding\(inset\.left, inset\.top, inset\.right, inset\.bottom\)/);
|
||||
});
|
||||
|
||||
it('asks Android for nothing: the save screen needs no permission', () => {
|
||||
// Asking at run time or naming one; the APK check (aapt2) refuses any declared in the manifest.
|
||||
expect(kotlin).not.toMatch(/requestPermissions\(|Manifest\.permission|checkSelfPermission/);
|
||||
|
||||
Reference in New Issue
Block a user