Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4028 - Macro: The 'Del' and 'Backspace' hotkey does not delete monomer when hovering and pressing, but only switches to Erase tool #4090

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions example/src/ModeControl/ModeControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
import { useState, useRef } from 'react';
import styled from '@emotion/styled';
import { Button, Popover } from '@mui/material';
import {
Icon,
KETCHER_ROOT_NODE_CSS_SELECTOR,
KETCHER_MACROMOLECULES_ROOT_NODE_SELECTOR,
} from 'ketcher-react';
import { Icon, KETCHER_ROOT_NODE_CSS_SELECTOR } from 'ketcher-react';
import { KETCHER_MACROMOLECULES_ROOT_NODE_SELECTOR } from 'ketcher-macromolecules';

interface IStyledIconProps {
expanded?: boolean;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
takeEditorScreenshot,
waitForPageInit,
waitForRender,
selectSnakeLayoutModeTool,
} from '@utils';

test.describe('Import-Saving-Files', () => {
Expand Down Expand Up @@ -328,7 +327,7 @@ test.describe('Import-Saving-Files', () => {
Description: Sequence of Peptides displaying according to snake view mockup.
*/
await openFileAndAddToCanvas('KET/snake-mode-peptides.ket', page);
await selectSnakeLayoutModeTool(page);
await page.getByTestId('snake-mode').click();
await takeEditorScreenshot(page);
});

Expand All @@ -343,7 +342,7 @@ test.describe('Import-Saving-Files', () => {
'Molfiles-V3000/snake-mode-peptides.mol',
page,
);
await selectSnakeLayoutModeTool(page);
await page.getByTestId('snake-mode').click();
await takeEditorScreenshot(page);
});

Expand All @@ -358,7 +357,7 @@ test.describe('Import-Saving-Files', () => {
'Molfiles-V3000/snake-mode-peptides.mol',
page,
);
await selectSnakeLayoutModeTool(page);
await page.getByTestId('snake-mode').click();
const expectedFile = await getMolfile(page);
await saveToFile(
'Molfiles-V3000/snake-mode-peptides-expected.mol',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import {
clickRedo,
clickUndo,
selectSingleBondTool,
selectSnakeLayoutModeTool,
selectSnakeBondTool,
takeEditorScreenshot,
waitForPageInit,
addBondedMonomersToCanvas,
selectFlexLayoutModeTool,
waitForRender,
} from '@utils';
import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
Expand Down Expand Up @@ -72,7 +70,7 @@ test.describe('Snake Bond Tool', () => {
Description: Snake bond tool
*/

await selectSnakeLayoutModeTool(page);
await selectSnakeBondTool(page);
const [, peptide2] = await addBondedMonomersToCanvas(
page,
MONOMER_NAME_TZA,
Expand Down Expand Up @@ -125,7 +123,7 @@ test.describe('Snake Bond Tool', () => {
12,
);

await selectSnakeLayoutModeTool(page);
await selectSnakeBondTool(page);

await takeEditorScreenshot(page);
});
Expand All @@ -139,33 +137,28 @@ test.describe('Snake Bond Tool', () => {
*/
await createBondedMonomers(page);
await takeEditorScreenshot(page);
await selectSnakeLayoutModeTool(page);
await selectSnakeBondTool(page);
await takeEditorScreenshot(page);
});

test('Mode returns back/forth after undo/redo', async ({ page }) => {
const flexModeButton = page.getByTestId('flex-layout-mode');
const snakeModeButton = page.getByTestId('snake-layout-mode');
test('Button is not active after undo', async ({ page }) => {
const snakeModeButton = page.getByTestId('snake-mode');
await createBondedMonomers(page);
await expect(flexModeButton).toHaveClass(/active/);
await expect(snakeModeButton).not.toHaveClass(/active/);

await selectSnakeLayoutModeTool(page);
await selectSnakeBondTool(page);
await expect(snakeModeButton).toHaveClass(/active/);

await clickUndo(page);
await waitForRender(page);
await expect(snakeModeButton).not.toBeVisible();
await expect(flexModeButton).toHaveClass(/active/);
await expect(snakeModeButton).not.toHaveClass(/active/);

await clickRedo(page);
await waitForRender(page);
await expect(flexModeButton).not.toBeVisible();
await expect(snakeModeButton).toHaveClass(/active/);
});

test('Create snake bond between RNA nucleotides', async ({ page }) => {
await page.getByText('RNA').click();
await selectSnakeLayoutModeTool(page);
await selectSnakeBondTool(page);

const { phosphate } = await addRnaPresetOnCanvas(
page,
Expand Down Expand Up @@ -251,7 +244,7 @@ test.describe('Snake Bond Tool', () => {
await bondTwoMonomers(page, phosphate2, sugar3);
await bondTwoMonomers(page, phosphate3, sugar4);

await selectSnakeLayoutModeTool(page);
await selectSnakeBondTool(page);
await takeEditorScreenshot(page);
});

Expand Down Expand Up @@ -314,16 +307,16 @@ test.describe('Snake Bond Tool', () => {

await takeEditorScreenshot(page);

await selectSnakeLayoutModeTool(page);
await selectSnakeBondTool(page);
await takeEditorScreenshot(page);

await selectFlexLayoutModeTool(page);
await selectSnakeBondTool(page);
await takeEditorScreenshot(page);
});

test('Create snake bond for chain with nucleoside', async ({ page }) => {
await page.getByText('RNA').click();
await selectSnakeLayoutModeTool(page);
await selectSnakeBondTool(page);

const { phosphate } = await addRnaPresetOnCanvas(
page,
Expand Down Expand Up @@ -368,10 +361,10 @@ test.describe('Snake Bond Tool', () => {

await takeEditorScreenshot(page);

await selectFlexLayoutModeTool(page);
await selectSnakeBondTool(page);
await takeEditorScreenshot(page);

await selectSnakeLayoutModeTool(page);
await selectSnakeBondTool(page);
await takeEditorScreenshot(page);
});

Expand Down Expand Up @@ -475,7 +468,7 @@ test.describe('Snake Bond Tool', () => {
await bondTwoMonomers(page, hcyPeptide1, balPeptide1, undefined, 'R1');
await takeEditorScreenshot(page);

await selectSnakeLayoutModeTool(page);
await selectSnakeBondTool(page);
await takeEditorScreenshot(page);
});

Expand Down Expand Up @@ -515,7 +508,7 @@ test.describe('Snake Bond Tool', () => {

await takeEditorScreenshot(page);

await selectSnakeLayoutModeTool(page);
await selectSnakeBondTool(page);
await takeEditorScreenshot(page);
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
moveMouseToTheMiddleOfTheScreen,
} from '@utils';
import {
zoomWithMouseWheel,
scrollWithMouseWheel,
turnOnMacromoleculesEditor,
} from '@utils/macromolecules';

Expand Down Expand Up @@ -187,7 +187,7 @@ test.describe('Zoom Tool', () => {
}) => {
const selectionStart = { x: 200, y: 200 };
const selectionEnd = { x: 800, y: 800 };
await zoomWithMouseWheel(page, ZOOM_STEP);
await scrollWithMouseWheel(page, ZOOM_STEP);
await selectRectangleSelectionTool(page);
await selectRectangleArea(
page,
Expand All @@ -198,10 +198,10 @@ test.describe('Zoom Tool', () => {
);
await takeEditorScreenshot(page);

await zoomWithMouseWheel(page, -ZOOM_STEP);
await scrollWithMouseWheel(page, -ZOOM_STEP);
await takeEditorScreenshot(page);

await zoomWithMouseWheel(page, -ZOOM_STEP);
await scrollWithMouseWheel(page, -ZOOM_STEP);
});

test('Scroll canvas by mouse wheel', async ({ page }) => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
selectSingleBondTool,
takeEditorScreenshot,
waitForPageInit,
selectSnakeLayoutModeTool,
} from '@utils';
import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
Expand Down Expand Up @@ -398,7 +397,7 @@ test.describe('Rectangle Selection Tool', () => {
const x = 900;
const y = 500;
await openFileAndAddToCanvas('KET/snake-mode-peptides.ket', page);
await selectSnakeLayoutModeTool(page);
await page.getByTestId('snake-mode').click();
await page.keyboard.press('Control+a');
await page.getByText('Hhs').locator('..').first().hover();
await dragMouseTo(x, y, page);
Expand Down

This file was deleted.

Binary file not shown.
Binary file not shown.
Loading
Loading