diff --git a/cypress/integration/copyPaste.spec.js b/cypress/integration/copyPaste.spec.js index 59182cf29..7b4e5dcf0 100644 --- a/cypress/integration/copyPaste.spec.js +++ b/cypress/integration/copyPaste.spec.js @@ -3,7 +3,6 @@ describe("copyPaste", function () { cy.visit(""); }); // it(`isProtein mode - copy via hotkey`, () => { - // cy.tgToggle("isProtein"); // cy.contains(".tg-menu-bar button", "Edit").click(); // cy.contains(".bp3-menu-item", "Copy").click(); // cy.window().then(() => { @@ -18,7 +17,8 @@ describe("copyPaste", function () { // }); // }); it(`isProtein mode - copy genbank of protein`, () => { - cy.tgToggle("isProtein"); + cy.get(`[data-test="moleculeType"]`).select("Protein"); + cy.contains(".veRowViewFeature", "araC") .first() .trigger("contextmenu", { force: true }); @@ -37,7 +37,7 @@ describe("copyPaste", function () { }); }); it(`isProtein mode - copy protein sequence`, () => { - cy.tgToggle("isProtein"); + cy.get(`[data-test="moleculeType"]`).select("Protein"); cy.contains(".veRowViewFeature", "araC") .first() .trigger("contextmenu", { force: true }); diff --git a/cypress/integration/proteinEditor.spec.js b/cypress/integration/proteinEditor.spec.js index 8390c31f6..7f654dd2f 100644 --- a/cypress/integration/proteinEditor.spec.js +++ b/cypress/integration/proteinEditor.spec.js @@ -1,7 +1,7 @@ describe("proteinEditor", function () { beforeEach(() => { - cy.visit(""); - cy.tgToggle("isProtein"); + cy.visit("/#/Editor?moleculeType=Protein"); + // cy.get(`[data-test="moleculeType"]`).select('Protein') }); it(`annotations shouldn't have a strand field to edit and all annotations be 'forward'`, () => { cy.contains(".veRowViewPart", "Part 0").rightclick(); @@ -16,7 +16,7 @@ describe("proteinEditor", function () { }); it(`should be able to toggle between protein and dna mode after firing some actions`, () => { cy.contains(".veLabelText", "Part 0").click(); - cy.tgToggle("isProtein", false); + cy.get(`[data-test="moleculeType"]`).select("DNA"); cy.contains("Length: 5299 bps").should("exist"); }); it(`feature/part add/edit should be AA indexed`, () => { diff --git a/demo/src/EditorDemo/index.js b/demo/src/EditorDemo/index.js index 3e7c78298..6f87bac70 100644 --- a/demo/src/EditorDemo/index.js +++ b/demo/src/EditorDemo/index.js @@ -268,8 +268,7 @@ export default class EditorDemo extends React.Component { renderToggle({ that: this, type: "generatePng", - info: - "Passing generatePng=true will cause a .png image of the map to be output for optional download within the onSave handler (It will be returned as part of the first argument of the onSave handler under the key 'pngFile')." + info: "Passing generatePng=true will cause a .png image of the map to be output for optional download within the onSave handler (It will be returned as part of the first argument of the onSave handler under the key 'pngFile')." }), renderToggle({ that: this, @@ -286,14 +285,12 @@ export default class EditorDemo extends React.Component { renderToggle({ that: this, type: "onCreateNewFromSubsequence", - info: - "Passing a onCreateNewFromSubsequence handler will add the option for the user to create a new sequence from a selection of the sequence. The handler implementer will need to handle the actual steps that follow this" + info: "Passing a onCreateNewFromSubsequence handler will add the option for the user to create a new sequence from a selection of the sequence. The handler implementer will need to handle the actual steps that follow this" }), renderToggle({ that: this, type: "onDelete", - info: - "This onDelete callback is for deletion of the *entire* sequence from the menu bar. OVE has no default handler for full sequence delete" + info: "This onDelete callback is for deletion of the *entire* sequence from the menu bar. OVE has no default handler for full sequence delete" }), renderToggle({ that: this, @@ -442,6 +439,7 @@ updateEditor(store, "DemoEditor", { isSelect: true, options: ["DNA", "RNA", "Protein"], that: this, + label: "Molecule Type:", type: "moleculeType", info: ` The editor supports Amino Acid sequences and RNA sequences as well as DNA sequences! @@ -754,15 +752,13 @@ rightClickOverrides: { that: this, type: "forceHeightMode", label: "Force Height 500px", - info: - "You can force a height for the editor by passing `height:500` (same for width) " + info: "You can force a height for the editor by passing `height:500` (same for width) " })} {renderToggle({ that: this, type: "adjustCircularLabelSpacing", label: "Adjust circular label spacing", - info: - "You can adjust the spacing between labels in circular view as a function of the multiple of the font height by passing `fontHeightMultiplier: 2` (value is restricted to between 1.5 and 3.5; default is 2.4, 2.0 when toggle is true)" + info: "You can adjust the spacing between labels in circular view as a function of the multiple of the font height by passing `fontHeightMultiplier: 2` (value is restricted to between 1.5 and 3.5; default is 2.4, 2.0 when toggle is true)" })} {renderToggle({ that: this, diff --git a/demo/src/utils/renderToggle.js b/demo/src/utils/renderToggle.js index 7a857f3a6..7442b0d05 100644 --- a/demo/src/utils/renderToggle.js +++ b/demo/src/utils/renderToggle.js @@ -66,9 +66,10 @@ export default function renderToggle({ /> ); } else if (isSelect) { - const { style, ...rest } = sharedProps; + const { style, label, ...rest } = sharedProps; toggleOrButton = (