Skip to content

Commit

Permalink
chore: test
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Mar 31, 2024
1 parent 77dccd9 commit e1e8686
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/edgeless/selection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '../utils/actions/edgeless.js';
import {
addBasicBrushElement,
addBasicConnectorElement,
addBasicRectShapeElement,
clickInCenter,
dragBetweenCoords,
Expand Down Expand Up @@ -633,3 +634,25 @@ test('copilot selection rect should appears when drag with meta key pressed', as
await page.mouse.click(205, 150);
await expect(page.locator('.copilot-selection-rect')).toBeHidden();
});

test('should show single selection rect when selecting multiple connectors', async ({
page,
}) => {
await enterPlaygroundRoom(page);
await initEmptyEdgelessState(page);
await switchEditorMode(page);
await actions.zoomResetByKeyboard(page);

await addBasicConnectorElement(page, { x: 100, y: 200 }, { x: 300, y: 200 });
await addBasicConnectorElement(page, { x: 100, y: 230 }, { x: 300, y: 230 });
await addBasicConnectorElement(page, { x: 100, y: 260 }, { x: 300, y: 260 });

await dragBetweenCoords(page, { x: 50, y: 50 }, { x: 400, y: 290 });

expect(
await page
.locator('.affine-edgeless-selected-rect')
.locator('.element-handle')
.count()
).toBe(0);
});

0 comments on commit e1e8686

Please sign in to comment.