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

#4014 - Macro: Monomers (attachment points) cannot be connected by a bond in Firefox browser #4025

Merged
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
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
Loading