Fix wallpaper transparency, Recents setup guide, drawer animation, and widget resizing (#2)
This commit was merged in pull request #2.
This commit is contained in:
1 parent
2fa7bd745b
commit
3070db4fb4
15 files changed
+1011
-161
No files matched your search
+26
-1
@@ -38,6 +38,14 @@ const serve = () => new Promise((resolve) => {
|
||||
await p.waitForSelector(".hint");
|
||||
await shot(p, "00-blank-home");
|
||||
assert.ok(!(await p.$(".clock")), "home has no built-in clock");
|
||||
const demoBg = await p.evaluate(() => ({
|
||||
hasDemo: document.documentElement.classList.contains("demo"),
|
||||
htmlBgImage: getComputedStyle(document.documentElement).backgroundImage,
|
||||
bodyBgColor: getComputedStyle(document.body).backgroundColor,
|
||||
}));
|
||||
assert.ok(demoBg.hasDemo, "desktop mode adds .demo class");
|
||||
assert.ok(demoBg.htmlBgImage.includes("linear-gradient"), "desktop mode keeps gradient backdrop");
|
||||
assert.equal(demoBg.bodyBgColor, "rgba(0, 0, 0, 0)", "body itself stays transparent");
|
||||
const longpress = async (sel, fy = 0.5) => {
|
||||
const r = await p.locator(sel).first().boundingBox();
|
||||
await p.mouse.move(r.x + r.width / 2, r.y + r.height * fy);
|
||||
@@ -51,7 +59,9 @@ const serve = () => new Promise((resolve) => {
|
||||
const homeApps = () => p.$$eval(".slots .name", (ns) => ns.map((n) => n.textContent));
|
||||
// long press on the blank home: add apps through the drawer's pick mode
|
||||
await longpress(".hint");
|
||||
await p.evaluate(() => { document.querySelector(".sheet-overlay").__tag = "overlay"; });
|
||||
await p.click(".sheet-item >> text=Add apps"); await settle();
|
||||
assert.equal(await p.$eval(".drawer", (d) => d.__tag), undefined, "drawer does not recycle sheet-overlay");
|
||||
for (const i of [4, 8, 12]) await p.click(`.apps .tile:nth-child(${i})`);
|
||||
await settle();
|
||||
assert.equal(await p.$$eval(".apps .tile.on", (ts) => ts.length), 3);
|
||||
@@ -163,8 +173,22 @@ const serve = () => new Promise((resolve) => {
|
||||
// hold a widget without moving: resize handles; drag them to snap it to the grid
|
||||
await longpress(".widget-slot");
|
||||
assert.ok(!(await p.$(".sheet")), "a widget gets handles, not the menu");
|
||||
assert.ok(await p.$(".widget-slot.resizing .resize-handle[data-edge=rb]"));
|
||||
assert.equal(await p.textContent(".resize-size"), "5 × 2");
|
||||
for (const edge of ["l", "r", "t", "b", "rb"]) {
|
||||
const box = await p.locator(`.resize-handle[data-edge=${edge}]`).boundingBox();
|
||||
assert.ok(box, `handle ${edge} rendered`);
|
||||
assert.ok(box.width >= 36 && box.height >= 36, `handle ${edge} generous target: ${box.width}x${box.height}`);
|
||||
assert.ok(box.x >= 0 && box.x + box.width <= 390, `handle ${edge} stays inside viewport: [${box.x}, ${box.x + box.width}]`);
|
||||
}
|
||||
await shot(p, "05-resize-handles");
|
||||
// resting a finger >= 500ms on a resize handle must not lift the widget or open a menu
|
||||
const hr = await p.locator(".resize-handle[data-edge=r]").boundingBox();
|
||||
await p.mouse.move(hr.x + hr.width / 2, hr.y + hr.height / 2);
|
||||
await p.mouse.down(); await p.waitForTimeout(600);
|
||||
assert.ok(await p.$(".widget-slot.resizing"), "holding handle keeps resize mode");
|
||||
assert.ok(!(await p.$(".widget-slot.lifted")), "holding handle does not lift widget");
|
||||
assert.ok(!(await p.$(".sheet")), "holding handle does not open sheet");
|
||||
await p.mouse.up(); await settle();
|
||||
const size = () => p.$eval(".widget-slot", (w) => [Math.round(w.getBoundingClientRect().width), Math.round(w.getBoundingClientRect().height)]);
|
||||
const [w0] = await size();
|
||||
const tile = await p.locator(".slots .tile").first().boundingBox();
|
||||
@@ -177,6 +201,7 @@ const serve = () => new Promise((resolve) => {
|
||||
const [w1, h1] = await size();
|
||||
assert.ok(w1 < w0 && Math.abs(w1 - (2 * tile.width + 8)) < 3, `two columns wide: ${w1} (tile ${tile.width})`);
|
||||
assert.equal(h1, 2 * 64 + 8, "snapped to two whole rows of tiles");
|
||||
assert.equal(await p.textContent(".resize-size"), "2 × 2");
|
||||
assert.ok(await p.$(".widget-slot.resizing"), "letting go of a handle keeps the handles");
|
||||
await p.click(".resize-bar >> text=Done"); await settle();
|
||||
assert.ok(!(await p.$(".resize-handle")));
|
||||
|
||||
Reference in new issue
Block a user