Skip to content

Commit

Permalink
add IDT expected output files and update file type handling in autote…
Browse files Browse the repository at this point in the history
…sts (#6400)
  • Loading branch information
Zhirnoff authored Jan 31, 2025
1 parent be12e4e commit 709ffc7
Show file tree
Hide file tree
Showing 28 changed files with 182 additions and 256 deletions.

Large diffs are not rendered by default.

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.
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.
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 @@ -22,7 +22,6 @@ import {
getSequence,
openFile,
getFasta,
getIdt,
openFileAndAddToCanvasAsNewProjectMacro,
delay,
moveMouseAway,
Expand Down Expand Up @@ -629,19 +628,7 @@ test('Verify that changes made in the "Edit Connection Points" dialog are saved
await page.getByRole('button', { name: 'R1' }).first().click();
await page.getByRole('button', { name: 'R2' }).nth(1).click();
await pressButton(page, 'Reconnect');
const expectedFile = await getIdt(page);
await saveToFile('IDT/moe-idt-expected.idt', expectedFile);

const METADATA_STRING_INDEX = [1];

const { fileExpected: idtFileExpected, file: idtFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/IDT/moe-idt-expected.idt',
metaDataIndexes: METADATA_STRING_INDEX,
});

expect(idtFile).toEqual(idtFileExpected);
await verifyFileExport(page, 'IDT/moe-idt-expected.idt', FileType.IDT);
await openFileAndAddToCanvasAsNewProject('IDT/moe-idt-expected.idt', page);
await selectMacroBond(page, MacroBondTool.SINGLE);
await bondLine.hover();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
clickOnCanvas,
copyToClipboardByKeyboard,
getFasta,
getIdt,
getKet,
getMolfile,
getSequence,
Expand Down Expand Up @@ -54,6 +53,10 @@ import {
pressYesInConfirmYourActionDialog,
} from '@utils/macromolecules/sequence';
import { pressUndoButton } from '@utils/macromolecules/topToolBar';
import {
FileType,
verifyFileExport,
} from '@utils/files/receiveFileComparisonData';

let page: Page;
let sharedContext: BrowserContext;
Expand Down Expand Up @@ -2523,24 +2526,11 @@ test(`32. Verify saving and reopening a structure with replaced monomers in IDT`
await selectAndReplaceAllSymbols(page, replaceMonomer, sequence);

await takeEditorScreenshot(page, { hideMonomerPreview: true });

const expectedFile = await getIdt(page);
await saveToFile(
await verifyFileExport(
page,
'Common/Sequence-Mode-Replacement/replacement-expected.idt',
expectedFile,
FileType.IDT,
);

const METADATA_STRING_INDEX = [1];

const { fileExpected: idtFileExpected, file: idtFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Common/Sequence-Mode-Replacement/replacement-expected.idt',
metaDataIndexes: METADATA_STRING_INDEX,
});

expect(idtFile).toEqual(idtFileExpected);
await checkForKnownBugs(
replaceMonomer,
sequence,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rMrRrSrV/3Phos/
MRSV/3Phos/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NBDHKWY/3Phos/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rNrBrDrHrKrWrY/3Phos/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/52MOErA//i2MOErA//i2MOErA//i2MOErA//i2MOErA//i2MOErA//i2MOErA//i2MOErA//i2MOErA//i2MOErA//i2MOErA//i2MOErA/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A*C*G*C*G*C*G*A*C*T*A*T*A*C*G*C*G*C*C*T
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
+G*+C*+G*C*G*A*C*T*A*T*A*C*G*+C*+G*+C
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
A*C*G*C*G*C*G*A*C*T*A*T*A*C*G*C*G*C*C*T
/52MOErA/*/i2MOErC/*/i2MOErG/*/i2MOErC/*/i2MOErG/*C*G*A*C*T*A*T*A*C*G*/i2MOErC/*/i2MOErG/*/i2MOErC/*/i2MOErC/*/32MOErT/
+G*+C*+G*C*G*A*C*T*A*T*A*C*G*+C*+G*+C
mA*mC*mG*mC*mG*C*G*A*C*T*A*T*A*C*G*mC*mG*mC*mC*mU
/52MOErA/*/i2MOErC/*/i2MOErG/*/i2MOErC/*/i2MOErG/*/iMe-dC/G*A*/iMe-dC/T*A*T*A*/iMe-dC/G*/i2MOErC/*/i2MOErG/*/i2MOErC/*/i2MOErC/*/32MOErT/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/52MOErA/*/i2MOErC/*/i2MOErG/*/i2MOErC/*/i2MOErG/*/iMe-dC/G*A*/iMe-dC/T*A*T*A*/iMe-dC/G*/i2MOErC/*/i2MOErG/*/i2MOErC/*/i2MOErC/*/32MOErT/
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/52MOErA/*/i2MOErC/*/32MOErT/
/5Phos/ACG/3Phos/
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
getCdx,
getCdxml,
getCml,
getIdt,
getInchi,
getKet,
getMolfile,
Expand All @@ -28,6 +29,7 @@ export enum FileType {
SDF = 'sdf',
InChI = 'inchi',
RDF = 'rdf',
IDT = 'idt',
}

type FileTypeHandler =
Expand All @@ -45,6 +47,7 @@ const fileTypeHandlers: { [key in FileType]: FileTypeHandler } = {
[FileType.CML]: getCml,
[FileType.SDF]: getSdf,
[FileType.InChI]: getInchi,
[FileType.IDT]: getIdt,
};

async function getFileContent(
Expand Down

0 comments on commit 709ffc7

Please sign in to comment.