Skip to content

Commit

Permalink
#3338 - New S-Group type Query component level grouping
Browse files Browse the repository at this point in the history
 - Fix e2e tests
  • Loading branch information
AKZhuk committed Sep 25, 2023
1 parent 78a4ce2 commit 6a67ee8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ test.describe('S-Group Properties', () => {
test('Checking S-Group drop-down types', async ({ page }) => {
/*
Test case: EPMLSOPKET-1502
Description: Checking S-Group drop-down types 'Type' drop-down list with Data,
Multiple group, SRU polymer and Superatom items. Data item is selected by default;
Description: Checking S-Group drop-down types 'Type' drop-down list with Data,
Multiple group, SRU polymer, Superatom and Query Component items. Data item is selected by default;
*/
await selectRingButton(RingButton.Benzene, page);
await clickInTheMiddleOfTheScreen(page);
Expand Down Expand Up @@ -77,4 +77,18 @@ test.describe('S-Group Properties', () => {
await takeEditorScreenshot(page);
await page.getByRole('button', { name: 'Apply' }).click();
});

test('A query component is created', async ({ page }) => {
await selectRingButton(RingButton.Benzene, page);
await clickInTheMiddleOfTheScreen(page);

await selectLeftPanelButton(LeftPanelButton.S_Group, page);
const { x, y } = await getCoordinatesTopAtomOfBenzeneRing(page);
await page.mouse.click(x, y);
await page.getByRole('button', { name: 'Data' }).click();
await page.getByRole('option', { name: 'Query component' }).click();

await takeEditorScreenshot(page);
await page.getByRole('button', { name: 'Apply' }).click();
});
});
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 @@ -273,7 +273,7 @@ export function fromSgroupAction(
}

if (SGroup.isQuerySGroup(newSg)) {
return fromQueryGroupAction(
return fromQuerySGroupAction(
restruct,
newSg,
newSourceAtoms,
Expand Down Expand Up @@ -309,7 +309,7 @@ function fromAtomAction(restruct, newSg, sourceAtoms) {
);
}

function fromQueryGroupAction(restruct, newSg, sourceAtoms, targetAtoms) {
function fromQuerySGroupAction(restruct, newSg, sourceAtoms, targetAtoms) {
const selection: {
atoms: number[];
bonds: number[];
Expand Down
4 changes: 2 additions & 2 deletions packages/ketcher-react/src/script/editor/tool/sgroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ class SGroupTool implements Tool {
return;
}
const result = isQuerySGroup
? createQueryComponent(id, editor, newSg, selection, sg)
? createQuerySGroup(id, editor, newSg, selection, sg)
: fromContextType(id, editor, newSg, selection);

result && editor.update(result.action);
Expand All @@ -544,7 +544,7 @@ class SGroupTool implements Tool {
}
}

function createQueryComponent(
function createQuerySGroup(
id: number | null,
editor: Editor,
newSg,
Expand Down

0 comments on commit 6a67ee8

Please sign in to comment.