Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Commit

Permalink
fixing more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed Jun 17, 2021
1 parent 112d8f8 commit bf1fb5e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ They look like this:

# Protein Editor
OVE can be set up to view and edit proteins (Amino Acid sequences) as first class citizens.
The protein editor can be seen here: http://teselagen.github.io/openVectorEditor/#/Editor?isProtein=true
The protein editor can be seen here: http://teselagen.github.io/openVectorEditor/#/Editor?moleculeType=Protein

The editor supports Amino Acid sequences as well as DNA sequences!
Protein sequence mode is enabled by calling updateEditor with a protein sequenceData object:
Expand Down
14 changes: 0 additions & 14 deletions cypress/integration/copyPaste.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@ describe("copyPaste", function () {
beforeEach(() => {
cy.visit("");
});
// it(`isProtein mode - copy via hotkey`, () => {
// cy.contains(".tg-menu-bar button", "Edit").click();
// cy.contains(".bp3-menu-item", "Copy").click();
// cy.window().then(() => {
// assert(
// window.Cypress.textToCopy ===
// "FCILLAAVSGAEGWGYYGCDEELVGPLYARSLGASSYYSLLTAPRFARLHGISGWSPRIGDPNPWLQIDLMKKHRIRAVATQGSFNSWDWVTRYMLLYGDRVDSWTPFYQRGHNSTFFGNVNESAVVRHDLHFHFTARYIRIVPLAWNPRGKIGLRLGLYGCPYKADILYFDGDDAISYRFPRGVSRSLWDVFAFSFKTEEKDGLLLHAEGAQGDYVTLELEGAHLLLHMSLGSSPIQPRPGHTTVSAGGVLNDQHWHYVRVDRFGRDVNFTLDGYVQRFILNGDFERLNLDTEMFIGGLVGAARKNLAYRHNFRGCIENVIFNRVNIADLAVRRHSRITFEGKVAFRCLDPVPHPINFGGPHNFVQVPGFPRRGRLAVSFRFRTWDLTGLLLFSRLGDGLGHVELTLSEGQVNVSIAQSGRKKLQFAAGYRLNDGFWHEVNFVAQENHAVISIDDVEGAEVRVSYPLLIRTGTSYFFGGCPKPASRWDCHSNQTAFHGCMELLKVDGQLVNLTLVEGRRLGFYAEVLFDTCGITDRCSPNMCEHDGRCYQSWDDFICYCELTGYKGETCHTPLYKESCEAYRLSGKTSGNFTIDPDGSGPLKPFVVYCDIRENRAWTVVRHDRLWTTRVTGSSMERPFLGAIQYWNASWEEVSALANASQHCEQWIEFSCYNSRLLNTAGGYPYSFWIGRNEEQHFYWGGSQPGIQRCACGLDRSCVDPALYCNCDADQPQWRTDKGLLTFVDHLPVTQVVIGDTNRSTSEAQFFLRPLRCYGDRNSWNTISFHTGAALRFPPIRANHSLDVSFYFRTSAPSGVFLENMGGPYCQWRRPYVRVELNTSRDVVFAFDVGNGDENLTVHSDDFEFNDDEWHLVRAEINVK"
// );
// assert(
// window.Cypress.seqDataToCopy.proteinSequence ===
// "fcillaavsgaegwgyygcdeelvgplyarslgassyyslltaprfarlhgisgwsprigdpnpwlqidlmkkhriravatqgsfnswdwvtrymllygdrvdswtpfyqrghnstffgnvnesavvrhdlhfhftaryirivplawnprgkiglrlglygcpykadilyfdgddaisyrfprgvsrslwdvfafsfkteekdglllhaegaqgdyvtlelegahlllhmslgsspiqprpghttvsaggvlndqhwhyvrvdrfgrdvnftldgyvqrfilngdferlnldtemfigglvgaarknlayrhnfrgcienvifnrvniadlavrrhsritfegkvafrcldpvphpinfggphnfvqvpgfprrgrlavsfrfrtwdltglllfsrlgdglghveltlsegqvnvsiaqsgrkklqfaagyrlndgfwhevnfvaqenhavisiddvegaevrvsypllirtgtsyffggcpkpasrwdchsnqtafhgcmellkvdgqlvnltlvegrrlgfyaevlfdtcgitdrcspnmcehdgrcyqswddficyceltgykgetchtplykesceayrlsgktsgnftidpdgsgplkpfvvycdirenrawtvvrhdrlwttrvtgssmerpflgaiqywnasweevsalanasqhceqwiefscynsrllntaggypysfwigrneeqhfywggsqpgiqrcacgldrscvdpalycncdadqpqwrtdkglltfvdhlpvtqvvigdtnrstseaqfflrplrcygdrnswntisfhtgaalrfppiranhsldvsfyfrtsapsgvflenmggpycqwrrpyvrvelntsrdvvfafdvgngdenltvhsddfefnddewhlvraeinvk"
// );
// });
// });
it(`isProtein mode - copy genbank of protein`, () => {
cy.get(`[data-test="moleculeType"]`).select("Protein");

Expand Down
8 changes: 6 additions & 2 deletions cypress/integration/demo.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
describe("demo", function () {
it(`users should be able to search the options in the demo`, () => {
cy.visit("");
cy.contains(`.toggle-button-holder`, "isProtein").should("exist");
cy.contains(`.toggle-button-holder`, "Show Rotate Circular View").should(
"exist"
);
cy.get(`[placeholder="Search Options.."]`).type("Custom");
cy.contains(`.toggle-button-holder`, "isProtein").should("not.exist");
cy.contains(`.toggle-button-holder`, "Show Rotate Circular View").should(
"not.exist"
);
cy.contains(`.toggle-button-holder`, "Customize property tabs").should(
"exist"
);
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/rna.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ describe("rna editing in OVE", function () {
});

it(`should support rna editing`, () => {
cy.tgToggle(`isRna`);
cy.get(`[data-test="moleculeType"]`).select("RNA");
cy.contains("uuaugacaacuugacggcuacaucauucacuuuuucuuca");
cy.selectRange(10, 11);
cy.get(".veSelectionLayer").first().rightclick();
cy.get(".veSelectionLayer").first().rightclick({ force: true });
cy.contains(".bp3-menu-item", "Replace").click();
cy.focused().type("tguugttuuuuuuuuuuuuuuuaa{enter}");
cy.contains("Selecting 21 bps from 10 to 30"); //the t's should be filtered out
cy.contains("guuguuuuuuuuuuuuuuuaa");
});
it(`should support mixed rna and dna editing`, () => {
cy.tgToggle(`isMixedRnaAndDna`);
cy.get(`[data-test="moleculeType"]`).select("mixedRnaAndDna");
cy.contains("uuaugacaacuugacggcuacaucauucacuuuuucuuca").should("not.exist");
cy.contains("uuuugacgt");
cy.selectRange(10, 11);
Expand Down
14 changes: 13 additions & 1 deletion demo/src/EditorDemo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ updateEditor(store, "DemoEditor", {
})}
{renderToggle({
isSelect: true,
options: ["DNA", "RNA", "Protein"],
options: ["DNA", "RNA", "Protein", "mixedRnaAndDna"],
that: this,
label: "Molecule Type:",
type: "moleculeType",
Expand Down Expand Up @@ -504,6 +504,18 @@ certain dna specific tools and annotations are automatically disabled when isPro
readOnly: false,
sequenceData: { ...exampleSequenceData, isRna: true }
});
} else if (val === "mixedRnaAndDna") {
updateEditor(store, "DemoEditor", {
readOnly: false,
sequenceData: tidyUpSequenceData(
{
...exampleSequenceData,
sequence: "uuuu" + exampleSequenceData.sequence,
isMixedRnaAndDna: true
},
{}
)
});
} else {
updateEditor(store, "DemoEditor", {
readOnly: false,
Expand Down
2 changes: 1 addition & 1 deletion src/updateEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function updateEditor(
},
annotationVisibility: {
caret: true,
sequence: false,
sequence: true,
reverseSequence: false,
...annotationVisibility, //we spread this here to allow the user to override this .. if they must!
translations: false,
Expand Down

0 comments on commit bf1fb5e

Please sign in to comment.