Skip to content

Commit

Permalink
Merge pull request #4025 from epam/4014-macro-monomers-attachment-poi…
Browse files Browse the repository at this point in the history
…nts-cannot-be-connected-by-a-bond-in-firefox-browser

#4014 - Macro: Monomers (attachment points) cannot be connected by a bond in Firefox browser
  • Loading branch information
ilya-asiyuk-epam committed Feb 6, 2024
2 parents 4e1c24d + b3bfaea commit 6b2f58c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ async function openRGroupModalForTopAtom(page: Page) {
return { x, y };
}

async function selectRGroupFragmentTool(page: Page) {
await page.getByTestId('rgroup-attpoints-in-toolbar').first().click();
await page.getByTestId('rgroup-attpoints').first().click();
await page.getByTestId('rgroup-fragment').click();
}

const rGroupFromFile = 'R8';
const atomIndex = 3;
async function selectRGroups(page: Page, rGroups: string[]) {
Expand Down Expand Up @@ -144,15 +150,11 @@ test.describe('Open Ketcher', () => {
await selectDropdownTool(page, 'rgroup-label', 'rgroup-attpoints');
await clickOnAtom(page, 'C', atomIndex);
await page.getByLabel(AttachmentPoint.PRIMARY).check();
await clickModalButton(page, 'Apply');
await selectNestedTool(
page,
RgroupTool.R_GROUP_FRAGMENT,
RgroupTool.ATTACHMENT_POINTS,
);
await page.getByTestId('OK').click();
await selectRGroupFragmentTool(page);
await clickOnAtom(page, 'C', atomIndex);
await page.getByText(rGroupFromFile).click();
await clickModalButton(page, 'Apply');
await page.getByTestId('OK').click();
});

test('Remove R-Group member from R-Group', async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/ketcher-core/src/application/editor/tools/Bond.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class PolymerBond implements BaseTool {
}

public mouseUpAttachmentPoint(event) {
const renderer = event.toElement.__data__;
const renderer = event.target.__data__;
const isFirstMonomerHovered =
renderer === this.bondRenderer?.polymerBond?.firstMonomer?.renderer;

Expand Down Expand Up @@ -309,7 +309,7 @@ class PolymerBond implements BaseTool {
}

public mouseUpMonomer(event) {
const renderer = event.toElement.__data__;
const renderer = event.target.__data__;
const isFirstMonomerHovered =
renderer === this.bondRenderer?.polymerBond?.firstMonomer?.renderer;

Expand Down

0 comments on commit 6b2f58c

Please sign in to comment.