perfect target area thing
This commit is contained in:
parent
664252e0fc
commit
5bcf22e458
23 changed files with 668 additions and 432 deletions
|
|
@ -120,6 +120,11 @@ try {
|
|||
assert.equal(await evaluate('document.querySelectorAll(".tl-track:not(.palette)").length'), 1,
|
||||
'an ordinary symbol is an ordinary timeline row');
|
||||
|
||||
// The new symbol is now the active creation parent. Return to the tab root
|
||||
// to ask for a sibling lane in `main`; leaving it selected would correctly
|
||||
// create the lane inside that symbol.
|
||||
await evaluate(`re_frame.core.dispatch_sync(cljs.core.vector(
|
||||
cljs.core.keyword('arthur.events.ui/select'), null))`);
|
||||
await clickNew('lane');
|
||||
s = await shot();
|
||||
placed = mainInstances(s);
|
||||
|
|
@ -178,8 +183,11 @@ try {
|
|||
`the dropped clip remains in the explicit lane: ${JSON.stringify(s)}`);
|
||||
assert.equal(laneSymbols(s).length, 1, 'the drop creates no extra lane');
|
||||
|
||||
// A second explicit lane is a sibling in the open symbol even though the
|
||||
// first remains aimed. Move the clip between their linear tracks.
|
||||
// Return to the root active row, then make a sibling lane there. Lane
|
||||
// creation follows the selected target; the unit suite separately asserts
|
||||
// that leaving a symbol selected creates the lane inside that symbol.
|
||||
await evaluate(`re_frame.core.dispatch_sync(cljs.core.vector(
|
||||
cljs.core.keyword('arthur.events.ui/select'), null))`);
|
||||
await clickNew('lane');
|
||||
s = await shot();
|
||||
assert.equal(laneSymbols(s).length, 2, 'a second explicit command creates a second lane');
|
||||
|
|
@ -239,7 +247,7 @@ try {
|
|||
await shortcut('z', 'KeyZ');
|
||||
assert.equal(mainInstances(await shot()).length, 2, 'one undo restores the cut');
|
||||
await evaluate(`re_frame.core.dispatch_sync(cljs.core.vector(
|
||||
cljs.core.keyword('arthur.events.ui/aim'), null))`);
|
||||
cljs.core.keyword('arthur.events.ui/select'), null))`);
|
||||
await sleep(80);
|
||||
await shortcut('v', 'KeyV');
|
||||
assert.equal(mainInstances(await shot()).length, 3, 'paste uses the copied snapshot');
|
||||
|
|
|
|||
|
|
@ -501,6 +501,17 @@ async function main() {
|
|||
// the authored node, the raster preview and the document round trip.
|
||||
await page.eval(SEEK(0));
|
||||
await sleep(150);
|
||||
// A lane row means "new one-frame cel". This test authors drawing keys
|
||||
// across the existing take, so make that cel the active row first; creation
|
||||
// then enters the symbol it places, exactly as a person clicking its block.
|
||||
await page.eval(`(() => {
|
||||
const cel = document.querySelector('.tl-cel');
|
||||
if (!cel?.arthurCel?.select) return false;
|
||||
re_frame.core.dispatch_sync(cljs.core.vector(
|
||||
cljs.core.keyword('arthur.events.ui/select'), cel.arthurCel.select));
|
||||
return true;
|
||||
})()`);
|
||||
await sleep(150);
|
||||
const beforePaint = await page.eval(`(() => {
|
||||
const c = document.querySelector('canvas.stage');
|
||||
const d = c.getContext('2d').getImageData(25, 20, 1, 1).data;
|
||||
|
|
@ -513,7 +524,7 @@ async function main() {
|
|||
// A person cannot click twice inside one microtask; a test should not either.
|
||||
const armed = await page.eval(`(() => {
|
||||
const button = [...document.querySelectorAll('.palette-bar button')]
|
||||
.find(b => b.textContent === 'polygon');
|
||||
.find(b => b.textContent === 'pen');
|
||||
if (!button) return false;
|
||||
button.click();
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue