Skip to content

Commit

Permalink
Merge pull request #2835 from epam/#2824-tooltip-for-sl-button-is-sho…
Browse files Browse the repository at this point in the history
…wing-custom-template-instead-structure-library

#2824 Tooltip for SL button is showing 'Custom Template' instead 'Structure Library'
  • Loading branch information
AnastasiiaPlyako authored Jun 30, 2023
2 parents 19ed9d5 + ff45465 commit b8b78cb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion documentation/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ _NOTE: `Mod` key is `Command` on OSX and `Ctrl` on PC systems_
**Templates**
| Shortcut | Action |
| --------- | ------------------------------------------------------------------------------------------------------------------------- |
| `Shift+t` | Custom Templates |
| `Shift+t` | Structure Library |
| `t` | Rotate between: Benzene, Cyclopentadiene, Cyclohexane, Cyclopentane, Cyclopropane, Cyclobutane, Cycloheptane, Cyclooctane |

**FunctionalGroups**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {
moveMouseToTheMiddleOfTheScreen,
selectAtomInToolbar,
takeEditorScreenshot,
pressButton,
AtomButton,
selectFunctionalGroups,
selectSaltsAndSolvents,
FunctionalGroups,
resetCurrentTool,
SaltsAndSolvents,
selectTemplate,
} from '@utils';

test.describe('Click Functional Group on canvas', () => {
Expand All @@ -33,7 +33,7 @@ test.describe('Click Functional Group on canvas', () => {
*/
await selectAtomInToolbar(AtomButton.Nitrogen, page);
await clickInTheMiddleOfTheScreen(page);
await pressButton(page, 'Custom Templates');
await selectTemplate(page);
await page.getByRole('tab', { name: 'Functional Groups' }).click();
await selectFunctionalGroups(FunctionalGroups.Boc, page);
await clickInTheMiddleOfTheScreen(page);
Expand All @@ -44,11 +44,11 @@ test.describe('Click Functional Group on canvas', () => {
Test case: EPMLSOPKET-10106
Description: when clicking with an FG template on an FG it should replace it
*/
await pressButton(page, 'Custom Templates');
await selectTemplate(page);
await page.getByRole('tab', { name: 'Functional Groups' }).click();
await selectFunctionalGroups(FunctionalGroups.Boc, page);
await clickInTheMiddleOfTheScreen(page);
await pressButton(page, 'Custom Templates');
await selectTemplate(page);
await selectFunctionalGroups(FunctionalGroups.Cbz, page);
await clickInTheMiddleOfTheScreen(page);
});
Expand All @@ -58,12 +58,12 @@ test.describe('Click Functional Group on canvas', () => {
Test case: EPMLSOPKET-10107
Description: when clicking with an FG template on a Salts and Solvents it should replace it
*/
await pressButton(page, 'Custom Templates');
await selectTemplate(page);
await page.getByRole('tab', { name: 'Salts and Solvents' }).click();
await selectSaltsAndSolvents(SaltsAndSolvents.MethaneSulphonicAcid, page);
await clickInTheMiddleOfTheScreen(page);

await pressButton(page, 'Custom Templates');
await selectTemplate(page);
await page.getByRole('tab', { name: 'Functional Groups' }).click();
await selectFunctionalGroups(FunctionalGroups.CCl3, page);
await clickInTheMiddleOfTheScreen(page);
Expand All @@ -84,7 +84,7 @@ test.describe('Click Functional Group on canvas', () => {
await dragMouseTo(coordinatesWithShift, y, page);
await resetCurrentTool(page);

await pressButton(page, 'Custom Templates');
await selectTemplate(page);
await page.getByRole('tab', { name: 'Functional Groups' }).click();
await selectFunctionalGroups(FunctionalGroups.CO2tBu, page);
await clickInTheMiddleOfTheScreen(page);
Expand All @@ -98,15 +98,15 @@ test.describe('Click Functional Group on canvas', () => {
await selectAtomInToolbar(AtomButton.Oxygen, page);
await clickInTheMiddleOfTheScreen(page);

await pressButton(page, 'Custom Templates');
await selectTemplate(page);
await page.getByRole('tab', { name: 'Functional Groups' }).click();
await selectFunctionalGroups(FunctionalGroups.Cbz, page);
await moveMouseToTheMiddleOfTheScreen(page);
const { x, y } = await getCoordinatesOfTheMiddleOfTheScreen(page);
const coordinatesWithShift = x + MAX_BOND_LENGTH;
await dragMouseTo(coordinatesWithShift, y, page);

await pressButton(page, 'Custom Templates');
await selectTemplate(page);
await page.getByRole('tab', { name: 'Functional Groups' }).click();
await selectFunctionalGroups(FunctionalGroups.Ms, page);
await page.mouse.click(coordinatesWithShift, y);
Expand Down
2 changes: 1 addition & 1 deletion ketcher-autotests/tests/utils/selectors/buttons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export enum RingButton {
Cyclooctane = 'Cyclooctane',
}

export const CustomTemplatesButton = 'Custom Templates';
export const CustomTemplatesButton = 'Structure Library';

export type ToolbarButton =
| AtomButton
Expand Down
6 changes: 3 additions & 3 deletions ketcher-autotests/tests/utils/selectors/templateModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
dragMouseTo,
getCoordinatesOfTheMiddleOfTheScreen,
moveMouseToTheMiddleOfTheScreen,
pressButton,
selectLeftPanelButton,
takeEditorScreenshot,
selectTemplate,
} from '@utils';

export enum SaltsAndSolvents {
Expand Down Expand Up @@ -102,7 +102,7 @@ export async function drawFGAndDrag(
shift: number,
page: Page
) {
await pressButton(page, 'Custom Templates');
await selectTemplate(page);
await page.getByRole('tab', { name: 'Functional Groups' }).click();
await selectFunctionalGroups(itemToChoose, page);
await moveMouseToTheMiddleOfTheScreen(page);
Expand All @@ -119,7 +119,7 @@ export async function drawSaltAndDrag(
shift: number,
page: Page
) {
await pressButton(page, 'Custom Templates');
await selectTemplate(page);
await page.getByRole('tab', { name: 'Salts and Solvents' }).click();
await selectSaltsAndSolvents(itemToChoose, page);
await moveMouseToTheMiddleOfTheScreen(page);
Expand Down
2 changes: 1 addition & 1 deletion packages/ketcher-react/src/script/ui/action/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import isHidden from './isHidden'
const templateLib = {
'template-lib': {
shortcut: 'Shift+t',
title: 'Custom Templates',
title: 'Structure Library',
action: { dialog: 'templates', prop: { tab: null } },
selected: (editor) => editor._tool.mode === 'classic',
disabled: (editor, server, options) => !options.app.templates,
Expand Down

0 comments on commit b8b78cb

Please sign in to comment.