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

#4780 - Remove monomers form the library (Peptides and CHEMs) #5178

Merged
merged 3 commits into from
Jul 29, 2024
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
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 @@ -13,6 +13,7 @@ import {
turnOnMicromoleculesEditor,
} from '@utils/macromolecules';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
import { Peptides } from '@utils/selectors/macromoleculeEditor';
/* eslint-disable no-magic-numbers */

test.describe('Clear Canvas Tool', () => {
Expand All @@ -29,7 +30,7 @@ test.describe('Clear Canvas Tool', () => {
*/

// Create 4 peptides on canvas
const MONOMER_NAME = 'Tza___3-thiazolylalanine';
const MONOMER_NAME = Peptides.Tza;
const MONOMER_ALIAS = 'Tza';

const peptide1 = await addSingleMonomerToCanvas(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
turnOnMacromoleculesEditor,
} from '@utils/macromolecules';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
import { Peptides } from '@utils/selectors/macromoleculeEditor';
/* eslint-disable no-magic-numbers */

test.describe('Erase Tool', () => {
Expand All @@ -37,7 +38,7 @@ test.describe('Erase Tool', () => {
*/

// Create 4 peptides on canvas
const MONOMER_NAME = 'Tza___3-thiazolylalanine';
const MONOMER_NAME = Peptides.Tza;
const MONOMER_ALIAS = 'Tza';

const peptide1 = await addSingleMonomerToCanvas(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
dragMouseTo,
} from '@utils';
import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
import { Peptides } from '@utils/selectors/macromoleculeEditor';

test.describe('Import-Saving .ket Files', () => {
test.beforeEach(async ({ page }) => {
Expand Down Expand Up @@ -124,7 +125,7 @@ test.describe('Import-Saving .ket Files', () => {
Test case: Import/Saving files #3827 #3757
Description: The monomer name is present in the preview after opening the saved file.
*/
await page.getByTestId('Bal___beta-Alanine').click();
await page.getByTestId(Peptides.BetaAlanine).click();
await clickInTheMiddleOfTheScreen(page);
const expectedFile = await getKet(page);
await saveToFile('KET/monomer-expected.ket', expectedFile);
Expand Down Expand Up @@ -196,7 +197,7 @@ test.describe('Import-Saving .ket Files', () => {
Test case: Import/Saving files #4172
Description: "leavingGroup" section contain information about number of atoms.
*/
await page.getByTestId('D-2Nal___D-3-naphthylalanine').click();
await page.getByTestId(Peptides.D2Nal).click();
await clickInTheMiddleOfTheScreen(page);
const expectedFile = await getKet(page);
await saveToFile('KET/D-2Nal-expected.ket', expectedFile);
Expand Down
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 @@ -65,6 +65,7 @@ import {
import { bondTwoMonomersPointToPoint } from '@utils/macromolecules/polymerBond';
import { clickOnSequenceSymbol } from '@utils/macromolecules/sequence';
import { miewApplyButtonIsEnabled } from '@utils/common/loaders/waitForMiewApplyButtonIsEnabled';
import { Peptides } from '@utils/selectors/macromoleculeEditor';

const topLeftCorner = {
x: -325,
Expand Down Expand Up @@ -101,7 +102,7 @@ async function pasteFromClipboard(
}

async function addToFavoritesMonomers(page: Page) {
await page.getByTestId('Bal___beta-Alanine').getByText('★').click();
await page.getByTestId(Peptides.BetaAlanine).getByText('★').click();
await page
.getByTestId('Phe4Me___p-Methylphenylalanine')
.getByText('★')
Expand Down Expand Up @@ -582,7 +583,7 @@ test.describe('Macro-Micro-Switcher', () => {
After closing the ticket, should update the screenshots.

*/
await page.getByTestId('Bal___beta-Alanine').click();
await page.getByTestId(Peptides.BetaAlanine).click();
await clickInTheMiddleOfTheScreen(page);
await turnOnMicromoleculesEditor(page);
await selectRing(RingButton.Benzene, page);
Expand All @@ -608,7 +609,7 @@ test.describe('Macro-Micro-Switcher', () => {
);
}
});
await page.getByTestId('Bal___beta-Alanine').click();
await page.getByTestId(Peptides.BetaAlanine).click();
await clickInTheMiddleOfTheScreen(page);
await turnOnMicromoleculesEditor(page);
await turnOnMacromoleculesEditor(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.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
waitForPageInit,
} from '@utils';
import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
import { Chems } from '@utils/selectors/macromoleculeEditor';

test.describe('Peptide library testing', () => {
test.beforeEach(async ({ page }) => {
Expand All @@ -33,7 +34,7 @@ test.describe('Peptide library testing', () => {

test('Placing betaAlanine on canvas', async ({ page }) => {
// placing molecule on canvas and molecule selected state check
await addPeptideOnCanvas(page, 'Bal___beta-Alanine');
await addPeptideOnCanvas(page, 'bAla___beta-Alanine');
await takeEditorScreenshot(page);
});

Expand Down Expand Up @@ -208,7 +209,7 @@ test.describe('Peptide library testing', () => {
Description: A tooltip appears when hovering over a CHEM on canvas while Selection tool is selected.
*/
await page.getByTestId('CHEM-TAB').click();
await page.getByTestId('SMPEG2___SM(PEG)2 linker from Pierce').click();
await page.getByTestId(Chems.SMPEG2).click();
await clickInTheMiddleOfTheScreen(page);
await selectRectangleSelectionTool(page);
await page.getByText('SMPEG2').locator('..').first().hover();
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.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from '@utils';
import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
import { Peptides } from '@utils/selectors/macromoleculeEditor';

test.describe('Check attachment point hover', () => {
test.beforeEach(async ({ page }) => {
Expand All @@ -17,7 +18,7 @@ test.describe('Check attachment point hover', () => {
test('Move monomer bonded with another monomers and hover attachment points', async ({
page,
}) => {
const MONOMER_NAME = 'Tza___3-thiazolylalanine';
const MONOMER_NAME = Peptides.Tza;
const MONOMER_ALIAS = 'Tza';
const coordinatesStart = { x: 300, y: 300 };
const peptide1 = await addSingleMonomerToCanvas(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@utils';
import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
import { Peptides } from '@utils/selectors/macromoleculeEditor';
/* eslint-disable no-magic-numbers */

test.describe('Check attachment point rotation', () => {
Expand All @@ -24,7 +25,7 @@ test.describe('Check attachment point rotation', () => {
*/

// Create 4 peptides on canvas
const MONOMER_NAME = 'Tza___3-thiazolylalanine';
const MONOMER_NAME = Peptides.Tza;
const MONOMER_ALIAS = 'Tza';

// Get 4 peptides locators
Expand Down Expand Up @@ -94,7 +95,7 @@ test.describe('Check attachment point rotation', () => {
Description: when monomers are moved, attachment points move also
*/

const MONOMER_NAME = 'Tza___3-thiazolylalanine';
const MONOMER_NAME = Peptides.Tza;
const MONOMER_ALIAS = 'Tza';

// Get 4 peptides locators
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 @@ -12,6 +12,7 @@ import {
} from '@utils/macromolecules';
import { connectMonomersWithBonds } from '@utils/macromolecules/monomer';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
import { Chems, Peptides } from '@utils/selectors/macromoleculeEditor';
/* eslint-disable no-magic-numbers */

test.describe('Polymer Bond Tool', () => {
Expand All @@ -30,7 +31,7 @@ test.describe('Polymer Bond Tool', () => {
Description: Polymer bond tool
*/
// Choose peptide
const MONOMER_NAME = 'Tza___3-thiazolylalanine';
const MONOMER_NAME = Peptides.Tza;
const MONOMER_ALIAS = 'Tza';

const peptide1 = await addSingleMonomerToCanvas(
Expand Down Expand Up @@ -88,7 +89,7 @@ test.describe('Polymer Bond Tool', () => {
*/
// Choose chems
await page.getByText('CHEM').click();
await page.getByTestId('hxy___Hexynyl alcohol').click();
await page.getByTestId(Chems.hxy).click();

// Create 2 chems on canvas
await page.mouse.click(300, 300);
Expand Down Expand Up @@ -126,7 +127,7 @@ test.describe('Signle Bond Tool', () => {
Description: The system shall unable user to create more
than 1 bond between the first and the second monomer
*/
const MONOMER_NAME = 'Tza___3-thiazolylalanine';
const MONOMER_NAME = Peptides.Tza;
const MONOMER_ALIAS = 'Tza';
const peptide1 = await addSingleMonomerToCanvas(
page,
Expand Down Expand Up @@ -165,9 +166,9 @@ test.describe('Signle Bond Tool', () => {
const x = 800;
const y = 350;
await page.locator('.css-1kbfai8').click();
await page.getByTestId('Bal___beta-Alanine').click();
await page.getByTestId(Peptides.BetaAlanine).click();
await clickInTheMiddleOfTheScreen(page);
await page.getByTestId('Edc___S-ethylthiocysteine').click();
await page.getByTestId(Peptides.Ethylthiocysteine).click();
await page.mouse.click(x, y);
await connectMonomersWithBonds(page, ['Bal', 'Edc']);
await takeEditorScreenshot(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.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
toggleRnaBuilderAccordion,
toggleSugarsAccordion,
} from '@utils/macromolecules/rnaBuilder';
import { Chems } from '@utils/selectors/macromoleculeEditor';

async function expandCollapseRnaBuilder(page: Page) {
await page
Expand Down Expand Up @@ -1349,7 +1350,7 @@ test.describe('RNA Library', () => {
await moveMouseAway(page);

// Case 24
await page.getByTestId('SMPEG2___SM(PEG)2 linker from Pierce').hover();
await page.getByTestId(Chems.SMPEG2).hover();
await delay(1);
await takeMonomerLibraryScreenshot(page);
await moveMouseAway(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.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test.describe('Rectangle Selection Tool', () => {
*/

// Create 4 peptides on canvas
const MONOMER_NAME = 'Tza___3-thiazolylalanine';
const MONOMER_NAME = Peptides.Tza;
const MONOMER_ALIAS = 'Tza';

const peptide1 = await addSingleMonomerToCanvas(
Expand Down Expand Up @@ -191,7 +191,7 @@ test.describe('Rectangle Selection Tool', () => {
*/

// Create 4 peptides on canvas
const MONOMER_NAME = 'Tza___3-thiazolylalanine';
const MONOMER_NAME = 'Tza___3-(4-Thiazolyl)-alanine';
const MONOMER_ALIAS = 'Tza';

const peptide1 = await addSingleMonomerToCanvas(
Expand Down Expand Up @@ -385,9 +385,9 @@ test.describe('Rectangle Selection Tool', () => {
*/
const x = 200;
const y = 200;
await addPeptideOnCanvas(page, 'Nal___3-naphthylalanine');
await addPeptideOnCanvas(page, '2Nal___3-(2-naphthyl)-alanine');
await selectRectangleSelectionTool(page);
await page.getByText('Nal').locator('..').first().hover();
await page.getByText('2Nal').locator('..').first().hover();
await dragMouseTo(x, y, page);
await page.getByTestId('undo').click();
await takeEditorScreenshot(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.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ import {
turnOnMicromoleculesEditor,
} from '@utils/macromolecules';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
import { Peptides } from '@utils/selectors/macromoleculeEditor';
/* eslint-disable no-magic-numbers */

const MONOMER_NAME_TZA = 'Tza___3-thiazolylalanine';
const MONOMER_NAME_TZA = Peptides.Tza;
const MONOMER_ALIAS_TZA = 'Tza';

async function createBondedMonomers(page: Page) {
const MONOMER_NAME_DSEC = 'dSec___D-SelenoCysteine';
const MONOMER_ALIAS_DSEC = 'dSec';
const MONOMER_NAME_DSEC = 'dU___D-selenocysteine';
const MONOMER_ALIAS_DSEC = 'dU';
const MONOMER_NAME_MEC = 'meC___N-Methyl-Cysteine';
const MONOMER_ALIAS_MEC = 'meC';

Expand Down Expand Up @@ -365,8 +366,8 @@ test.describe('Snake Bond Tool', () => {
await page.getByTestId('PEPTIDES-TAB').click();
await addBondedMonomersToCanvas(
page,
'Bal___beta-Alanine',
'Bal',
Peptides.BetaAlanine,
'bAla',
700,
500,
50,
Expand Down Expand Up @@ -541,8 +542,8 @@ test.describe('Snake Bond Tool', () => {

const [balPeptide] = await addBondedMonomersToCanvas(
page,
'Bal___beta-Alanine',
'Bal',
Peptides.BetaAlanine,
'bAla',
700,
700,
50,
Expand All @@ -551,8 +552,8 @@ test.describe('Snake Bond Tool', () => {
);
const balPeptide1 = await addSingleMonomerToCanvas(
page,
'Bal___beta-Alanine',
'Bal',
Peptides.BetaAlanine,
'bAla',
850,
650,
2,
Expand All @@ -577,8 +578,8 @@ test.describe('Snake Bond Tool', () => {
test('Create snake mode for single monomer and nucleoside', async () => {
await addSingleMonomerToCanvas(
page,
'Bal___beta-Alanine',
'Bal',
Peptides.BetaAlanine,
'bAla',
300,
300,
0,
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 @@ -21,6 +21,7 @@ import {
moveMonomer,
} from '@utils/macromolecules/monomer';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
import { Peptides } from '@utils/selectors/macromoleculeEditor';
/* eslint-disable no-magic-numbers */

test.describe('Undo Redo', () => {
Expand All @@ -29,7 +30,7 @@ test.describe('Undo Redo', () => {
test.beforeEach(async ({ page }) => {
await waitForPageInit(page);
await turnOnMacromoleculesEditor(page);
const MONOMER_NAME = 'Tza___3-thiazolylalanine';
const MONOMER_NAME = Peptides.Tza;
const MONOMER_ALIAS = 'Tza';

peptide1 = await addSingleMonomerToCanvas(
Expand Down Expand Up @@ -195,7 +196,7 @@ test.describe('Undo-Redo tests', () => {
*/

const addMonomers = async (x: number, y: number) => {
await page.getByTestId('Bal___beta-Alanine').click();
await page.getByTestId(Peptides.BetaAlanine).click();
await page.mouse.click(x, y);
};

Expand Down Expand Up @@ -235,7 +236,7 @@ test.describe('Undo-Redo tests', () => {

const addMonomers = async (x: number, y: number) => {
await page.getByTestId('CHEM-TAB').click();
await page.getByTestId('SMPEG2___SM(PEG)2 linker from Pierce').click();
await page.getByTestId('SMPEG2___SM(PEG)2').click();
await page.mouse.click(x, y);
};

Expand Down
Loading
Loading