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

perform vector simplication before comparisons #1962

Merged
merged 2 commits into from
Mar 3, 2023
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
422 changes: 211 additions & 211 deletions cypress/e2e/DoenetML/assignNames/collections.cy.js

Large diffs are not rendered by default.

1,364 changes: 882 additions & 482 deletions cypress/e2e/DoenetML/equality/mathexpressions.cy.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cypress/e2e/DoenetML/tagSpecific/choiceinput.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ describe('ChoiceInput Tag Tests', function () {
<choice>The function is <m>f(\\xi)=\\sin(\\xi)</m>.</choice>
<choice>The sum of <math name="lambda2">lambda^2</math> and <math name="twice">2 lambda^2</math> is <math simplify><copy target="lambda2" />+<copy target="twice" /></math>.</choice>
<choice>The sequence is <aslist><sequence from="1" to="5" /></aslist>.</choice>
<choice>Can't convert this latex: <m>\\int_a^b q(t) \\, dt</m>.</choice>
<choice>Can't convert this latex: <m>\\bar{x}^i</m>.</choice>
</choiceinput>

<copy name="copy" inline target="ci1" assignNames="ci2" createComponentOfType="choiceinput" />
Expand All @@ -501,7 +501,7 @@ describe('ChoiceInput Tag Tests', function () {
"The function is f(ξ) = sin(ξ).",
"The sum of λ² and 2 λ² is 3 λ².",
"The sequence is 1, 2, 3, 4, 5.",
"Can't convert this latex: \\int_a^b q(t) \\, dt."
"Can't convert this latex: \\bar{x}^i."
];
cy.get('#\\/_p1').should('have.text', 'Selected values: ')
cy.get('#\\/_p2').should('have.text', 'Selected indices: ')
Expand Down
32 changes: 16 additions & 16 deletions cypress/e2e/DoenetML/tagSpecific/circle.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8989,31 +8989,31 @@ describe('Circle Tag Tests', function () {
cy.get('#\\/P2 .mjx-mrow').should('not.exist');
cy.get('#\\/P3 .mjx-mrow').should('not.exist');
cy.get('#\\/x .mjx-mrow').should('not.exist');
cy.get('#\\/n textarea').type("1{enter}", {force: true});

cy.get('#\\/n textarea').type("1{enter}", { force: true });
cy.get('#\\/P1 .mjx-mrow').should('contain.text', `(${nInDOM(t1x)},${nInDOM(t1y)})`);
cy.get('#\\/P2 .mjx-mrow').should('not.exist');
cy.get('#\\/P3 .mjx-mrow').should('not.exist');
cy.get('#\\/x .mjx-mrow').should('contain.text', `${nInDOM(t2x)}`);

cy.get('#\\/n textarea').type("{end}{backspace}2{enter}", {force: true});
cy.get('#\\/n textarea').type("{end}{backspace}2{enter}", { force: true });
cy.get('#\\/P1 .mjx-mrow').should('contain.text', `(${nInDOM(t2x)},${nInDOM(t2y)})`);
cy.get('#\\/P2 .mjx-mrow').should('not.exist');
cy.get('#\\/P3 .mjx-mrow').should('not.exist');
cy.get('#\\/x .mjx-mrow').should('contain.text', `${nInDOM(t2y)}`);
cy.get('#\\/n textarea').type("{end}{backspace}3{enter}", {force: true});

cy.get('#\\/n textarea').type("{end}{backspace}3{enter}", { force: true });
cy.get('#\\/P1 .mjx-mrow').should('contain.text', `(${nInDOM(t3x)},${nInDOM(t3y)})`);
cy.get('#\\/P2 .mjx-mrow').should('not.exist');
cy.get('#\\/P3 .mjx-mrow').should('not.exist');
cy.get('#\\/x .mjx-mrow').should('not.exist');
cy.get('#\\/n textarea').type("{end}{backspace}4{enter}", {force: true});

cy.get('#\\/n textarea').type("{end}{backspace}4{enter}", { force: true });
cy.get('#\\/P1 .mjx-mrow').should('not.exist');
cy.get('#\\/P2 .mjx-mrow').should('not.exist');
cy.get('#\\/P3 .mjx-mrow').should('not.exist');
cy.get('#\\/x .mjx-mrow').should('not.exist');


});

Expand Down Expand Up @@ -9045,31 +9045,31 @@ describe('Circle Tag Tests', function () {
cy.get('#\\/P2 .mjx-mrow').should('not.exist');
cy.get('#\\/P3 .mjx-mrow').should('not.exist');
cy.get('#\\/x .mjx-mrow').should('not.exist');
cy.get('#\\/n textarea').type("1{enter}", {force: true});

cy.get('#\\/n textarea').type("1{enter}", { force: true });
cy.get('#\\/P1 .mjx-mrow').should('contain.text', `(${nInDOM(t1x)},${nInDOM(t1y)})`);
cy.get('#\\/P2 .mjx-mrow').should('not.exist');
cy.get('#\\/P3 .mjx-mrow').should('not.exist');
cy.get('#\\/x .mjx-mrow').should('contain.text', `${nInDOM(t2x)}`);

cy.get('#\\/n textarea').type("{end}{backspace}2{enter}", {force: true});
cy.get('#\\/n textarea').type("{end}{backspace}2{enter}", { force: true });
cy.get('#\\/P1 .mjx-mrow').should('contain.text', `(${nInDOM(t2x)},${nInDOM(t2y)})`);
cy.get('#\\/P2 .mjx-mrow').should('not.exist');
cy.get('#\\/P3 .mjx-mrow').should('not.exist');
cy.get('#\\/x .mjx-mrow').should('contain.text', `${nInDOM(t2y)}`);
cy.get('#\\/n textarea').type("{end}{backspace}3{enter}", {force: true});

cy.get('#\\/n textarea').type("{end}{backspace}3{enter}", { force: true });
cy.get('#\\/P1 .mjx-mrow').should('contain.text', `(${nInDOM(t3x)},${nInDOM(t3y)})`);
cy.get('#\\/P2 .mjx-mrow').should('not.exist');
cy.get('#\\/P3 .mjx-mrow').should('not.exist');
cy.get('#\\/x .mjx-mrow').should('not.exist');
cy.get('#\\/n textarea').type("{end}{backspace}4{enter}", {force: true});

cy.get('#\\/n textarea').type("{end}{backspace}4{enter}", { force: true });
cy.get('#\\/P1 .mjx-mrow').should('not.exist');
cy.get('#\\/P2 .mjx-mrow').should('not.exist');
cy.get('#\\/P3 .mjx-mrow').should('not.exist');
cy.get('#\\/x .mjx-mrow').should('not.exist');


});

Expand Down
23 changes: 22 additions & 1 deletion cypress/e2e/DoenetML/tagSpecific/copy.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14068,7 +14068,7 @@ describe('Copy Tag Tests', function () {
cy.get(cesc('#/p34') + ' .mjx-mrow').eq(1).should('not.exist');
cy.get(cesc('#/p35')).should('have.text', '')

cy.get(cesc('#/p36')).should('have.text', '0 = -23.1058 \\, x - 3.0203 \\, y + 120.4105');
cy.get(cesc('#/p36')).should('have.text', '0 = -23.1058 x - 3.0203 y + 120.4105');
cy.get(cesc('#/p37') + ' .mjx-mrow').eq(0).should('have.text', '(3.9264,9.8294)');
cy.get(cesc('#/p37') + ' .mjx-mrow').eq(3).should('have.text', '(0.9061,32.9352)');
cy.get(cesc('#/p38') + ' .mjx-mrow').eq(0).should('have.text', '(3.9264,9.8294)');
Expand Down Expand Up @@ -14937,4 +14937,25 @@ describe('Copy Tag Tests', function () {

});


it('correctly wrap replacement changes when verifying to force component type', () => {

cy.window().then(async (win) => {
win.postMessage({
doenetML: `
<answer name="ans">47</answer>
<number copySource="ans.submittedResponse" name="num" />
`}, "*");
});

cy.get('#\\/num').should('have.text', 'NaN')

cy.get('#\\/ans textarea').type("4{enter}", { force: true });
cy.get('#\\/num').should('have.text', '4')

cy.get('#\\/ans textarea').type("7{enter}", { force: true });
cy.get('#\\/num').should('have.text', '47')

});

});
6 changes: 3 additions & 3 deletions cypress/e2e/DoenetML/tagSpecific/curve.bezier.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10601,23 +10601,23 @@ describe('Curve Tag Bezier Tests', function () {
componentName: "/c",
args: {
controlVectorInds: [1, 0],
controlVector: [3,-5]
controlVector: [3, -5]
}
})
await win.callAction1({
actionName: "moveControlVector",
componentName: "/c",
args: {
controlVectorInds: [1, 1],
controlVector: [2,-4]
controlVector: [2, -4]
}
})
await win.callAction1({
actionName: "moveControlVector",
componentName: "/c",
args: {
controlVectorInds: [2, 0],
controlVector: [-2,-6]
controlVector: [-2, -6]
}
})
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/DoenetML/tagSpecific/curve.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ describe('Curve Tag Tests', function () {
throughPoint: ps[1]
}
});

stateVariables = await win.returnAllStateVariables1();
expect((stateVariables['/_curve1'].stateValues.throughPoints)[1]).eqls(ps[1]);
expect((stateVariables['/_curve2'].stateValues.throughPoints)[1]).eqls(psflipped[1]);
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/DoenetML/tagSpecific/curve.parametrized.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ describe('Parameterized Curve Tag Tests', function () {
});

cy.get('#\\/_text1').should('have.text', 'a'); //wait for window to load
cy.get("#\\/m1").should('contain.text', "2")
cy.get("#\\/m1 .mjx-mrow").should('contain.text', "2")

cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();
Expand All @@ -607,7 +607,7 @@ describe('Parameterized Curve Tag Tests', function () {
})

cy.get("#\\/_mathinput1 textarea").type("{end}{backspace}-3{enter}", { force: true });
cy.get("#\\/m1").should('contain.text', "−3")
cy.get("#\\/m1 .mjx-mrow").should('contain.text', "−3")
cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();
expect(stateVariables["/_curve1"].stateValues.parMin).eq(-10);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/DoenetML/tagSpecific/extract.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ describe('Extract Tag Tests', function () {
cy.log(`check properties`);
cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();
expect(stateVariables['/e1'].stateValues.value).eqls(["/", 1,2])
expect(stateVariables['/e1'].stateValues.value).eqls(["/", 1, 2])
expect(stateVariables['/e2'].stateValues.value).eq(0.75);
})

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/DoenetML/tagSpecific/group.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ describe('Group Tag Tests', function () {
cy.log('type in first textinput')
cy.get('#\\/g\\/ti_input').clear().type("bye{enter}")
cy.get('#\\/g\\/t').should('contain.text', 'bye')

cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();
expect(stateVariables['/g/ti'].stateValues.value).eq("bye")
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/DoenetML/tagSpecific/line.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ describe('Line Tag Tests', function () {
cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();

expect(stateVariables['/_line1'].stateValues.equation).eqls([ "/", "_", 2 ]);
expect(stateVariables['/_line1'].stateValues.equation).eqls(["/", "_", 2]);
expect(stateVariables['/_line1'].stateValues.coeff0).eq("\uff3f");
expect(stateVariables['/_line1'].stateValues.coeffvar1).eq("\uff3f");
expect(stateVariables['/_line1'].stateValues.coeffvar2).eq("\uff3f");
Expand All @@ -784,7 +784,7 @@ describe('Line Tag Tests', function () {
expect(stateVariables['/_line3'].stateValues.coeffvar1).eq("\uff3f");
expect(stateVariables['/_line3'].stateValues.coeffvar2).eq("\uff3f");

expect(stateVariables['/_line4'].stateValues.equation).eqls([ "/", "_", 2 ]);
expect(stateVariables['/_line4'].stateValues.equation).eqls(["/", "_", 2]);
expect(stateVariables['/_line4'].stateValues.coeff0).eq("\uff3f");
expect(stateVariables['/_line4'].stateValues.coeffvar1).eq("\uff3f");
expect(stateVariables['/_line4'].stateValues.coeffvar2).eq("\uff3f");
Expand Down
56 changes: 28 additions & 28 deletions cypress/e2e/DoenetML/tagSpecific/mathinput.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ describe('MathInput Tag Tests', function () {
// pause so that can detect change
cy.get(`#\\/iv1`).should('contain.text', 'x')
cy.get('#\\/mi1 textarea').type(`-`, { force: true }).blur();
cy.get(`#\\/iv1`).should('contain.text', 'x')
cy.get(`#\\/iv1`).should('contain.text', 'x-')

// since v1 was already invalid, can't be sure when have waited long enough
// so click boolean input and wait for its effect to take
Expand All @@ -1355,16 +1355,16 @@ describe('MathInput Tag Tests', function () {
})

cy.get(`#\\/v1`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x')
expect(text.trim()).equal('x-')
});
cy.get(`#\\/iv1`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x')
expect(text.trim()).equal('x-')
});
cy.get(`#\\/v1a`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x')
expect(text.trim()).equal('x-')
});
cy.get(`#\\/iv1a`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x')
expect(text.trim()).equal('x-')
});

cy.log('Test internal values are set to the correct values')
Expand Down Expand Up @@ -1408,16 +1408,16 @@ describe('MathInput Tag Tests', function () {
})

cy.get(`#\\/v1`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x')
expect(text.trim()).equal('x-')
});
cy.get(`#\\/iv1`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x')
expect(text.trim()).equal('x-')
});
cy.get(`#\\/v1a`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x')
expect(text.trim()).equal('x-')
});
cy.get(`#\\/iv1a`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x')
expect(text.trim()).equal('x-')
});

cy.log('Test internal values are set to the correct values')
Expand All @@ -1444,13 +1444,13 @@ describe('MathInput Tag Tests', function () {
})

cy.get(`#\\/v1`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x')
expect(text.trim()).equal('x-')
});
cy.get(`#\\/iv1`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x−y')
});
cy.get(`#\\/v1a`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x')
expect(text.trim()).equal('x-')
});
cy.get(`#\\/iv1a`).find('.mjx-mrow').eq(0).invoke('text').then((text) => {
expect(text.trim()).equal('x−y')
Expand Down Expand Up @@ -5762,7 +5762,7 @@ describe('MathInput Tag Tests', function () {
win.postMessage({
doenetML: `
<text>a</text>
<p>Prefill with m: <m>\\frac{a}{b} \\int_a^b f(x) dx</m></p>
<p>Prefill with m: <m>\\frac{a}{b} \\int_a^b \\hat{f}(x) dx</m></p>
<p>Result: <mathinput prefillLatex="$_m1" name="input1" /></p>
<p name="pv1">Value: $input1</p>
<p name="pr1">Raw value: $input1.rawRendererValue</p>
Expand All @@ -5784,10 +5784,10 @@ describe('MathInput Tag Tests', function () {


cy.get(`#\\/input1 .mq-editable-field`).invoke('text').then((text) => {
expect(text.replace(/[\s\u200B-\u200D\uFEFF]/g, '')).equal('ab∫baf(x)dx')
expect(text.replace(/[\s\u200B-\u200D\uFEFF]/g, '')).equal('ab∫ba^f(x)dx')
})
cy.get('#\\/pv1 .mjx-mrow').eq(0).should('have.text', '\uff3f')
cy.get('#\\/pr1').should('have.text', 'Raw value: \\frac{a}{b} \\int_a^b f(x) dx')
cy.get('#\\/pr1').should('have.text', 'Raw value: \\frac{a}{b} \\int_a^b \\hat{f}(x) dx')

cy.get(`#\\/input2 .mq-editable-field`).invoke('text').then((text) => {
expect(text.replace(/[\s\u200B-\u200D\uFEFF]/g, '')).equal('hellothere(a)(b)')
Expand All @@ -5806,7 +5806,7 @@ describe('MathInput Tag Tests', function () {
let stateVariables = await win.returnAllStateVariables1();
expect(stateVariables['/input1'].stateValues.value).eq('\uff3f');
expect(stateVariables['/input1'].stateValues.immediateValue).eq('\uff3f');
expect(stateVariables['/input1'].stateValues.rawRendererValue).eq('\\frac{a}{b} \\int_a^b f(x) dx');
expect(stateVariables['/input1'].stateValues.rawRendererValue).eq('\\frac{a}{b} \\int_a^b \\hat{f}(x) dx');
expect(stateVariables['/input2'].stateValues.value).eqls(["*", "h", "e", "l", "l", "o", "t", "h", "e", "r", "e", "a", "b"])
expect(stateVariables['/input2'].stateValues.immediateValue).eqls(["*", "h", "e", "l", "l", "o", "t", "h", "e", "r", "e", "a", "b"])
expect(stateVariables['/input2'].stateValues.rawRendererValue).eq('hello\\ there (a)(b)');
Expand All @@ -5815,19 +5815,19 @@ describe('MathInput Tag Tests', function () {
expect(stateVariables['/input3'].stateValues.rawRendererValue).eq('\\text{hello there} (a)(b)');
})

cy.get("#\\/input1 textarea").type("{ctrl+end}{leftArrow}{leftArrow}{leftArrow}{leftArrow}{leftArrow}{leftArrow}{backspace}{backspace}{backspace}{enter}", { force: true })
cy.get("#\\/input1 textarea").type("{ctrl+end}{leftArrow}{leftArrow}{leftArrow}{leftArrow}{leftArrow}{leftArrow}{backspace}{backspace}f{enter}", { force: true })

cy.get('#\\/pv1 .mjx-mrow').should('contain.text', '(ab)af(x)dx')
cy.get('#\\/pv1 .mjx-mrow').should('contain.text', '(ab)∫baf(x)dx')
cy.get(`#\\/input1 .mq-editable-field`).invoke('text').then((text) => {
expect(text.replace(/[\s\u200B-\u200D\uFEFF]/g, '')).equal('abaf(x)dx')
expect(text.replace(/[\s\u200B-\u200D\uFEFF]/g, '')).equal('ab∫baf(x)dx')
})
cy.get('#\\/pr1').should('have.text', 'Raw value: \\frac{a}{b}af(x)dx')
cy.get('#\\/pr1').should('have.text', 'Raw value: \\frac{a}{b}\\int_a^bf(x)dx')

cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();
expect(stateVariables['/input1'].stateValues.value).eqls(["*", ["/", "a", "b"], "a", ["apply", "f", "x"], "d", "x"])
expect(stateVariables['/input1'].stateValues.immediateValue).eqls(["*", ["/", "a", "b"], "a", ["apply", "f", "x"], "d", "x"])
expect(stateVariables['/input1'].stateValues.rawRendererValue).eq('\\frac{a}{b}af(x)dx');
// expect(stateVariables['/input1'].stateValues.value).eqls(["*", ["/", "a", "b"], "a", ["apply", "f", "x"], "d", "x"])
// expect(stateVariables['/input1'].stateValues.immediateValue).eqls(["*", ["/", "a", "b"], "a", ["apply", "f", "x"], "d", "x"])
expect(stateVariables['/input1'].stateValues.rawRendererValue).eq('\\frac{a}{b}\\int_a^bf(x)dx');
})

cy.get("#\\/input2 textarea").type("{ctrl+end}{leftArrow}{leftArrow}{leftArrow}{leftArrow}{leftArrow}{leftArrow}{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}{enter}", { force: true })
Expand Down Expand Up @@ -7557,13 +7557,13 @@ describe('MathInput Tag Tests', function () {
cy.get('#\\/mi2 textarea').type("{end}{shift+home}{backspace}$45.23{enter}", { force: true });
cy.get('#\\/mi3 textarea').type("{end}{shift+home}{backspace}$45.23{enter}", { force: true });

cy.get('#\\/m1 .mjx-mrow').should('contain.text', '\uff3f')
cy.get('#\\/m1 .mjx-mrow').should('contain.text', '$45.23')
cy.get('#\\/m2 .mjx-mrow').should('contain.text', '45.23')
cy.get('#\\/m3 .mjx-mrow').should('contain.text', '45.23')

cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();
expect(stateVariables["/mi1"].stateValues.value).eq('\uff3f')
expect(stateVariables["/mi1"].stateValues.value).eqls(['unit', '$', 45.23])
expect(stateVariables["/mi2"].stateValues.value).eq(45.23)
expect(stateVariables["/mi3"].stateValues.value).eq(45.23)
});
Expand All @@ -7573,13 +7573,13 @@ describe('MathInput Tag Tests', function () {
cy.get('#\\/mi2 textarea').type("{end}{shift+home}{backspace}78%{enter}", { force: true });
cy.get('#\\/mi3 textarea').type("{end}{shift+home}{backspace}78%{enter}", { force: true });

cy.get('#\\/m1 .mjx-mrow').should('contain.text', '\uff3f')
cy.get('#\\/m1 .mjx-mrow').should('contain.text', '78%')
cy.get('#\\/m2 .mjx-mrow').should('contain.text', '78')
cy.get('#\\/m3 .mjx-mrow').should('contain.text', '78')

cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();
expect(stateVariables["/mi1"].stateValues.value).eq('\uff3f')
expect(stateVariables["/mi1"].stateValues.value).eqls(['unit', 78, '%'])
expect(stateVariables["/mi2"].stateValues.value).eq(78)
expect(stateVariables["/mi3"].stateValues.value).eq(78)
});
Expand All @@ -7588,13 +7588,13 @@ describe('MathInput Tag Tests', function () {
cy.get('#\\/mi2 textarea').type(`{end}{shift+home}{backspace}$34,000%dx{enter}`, { force: true });
cy.get('#\\/mi3 textarea').type(`{end}{shift+home}{backspace}$34,000%dx{enter}`, { force: true });

cy.get('#\\/m1 .mjx-mrow').should('contain.text', '\uff3f')
cy.get('#\\/m1 .mjx-mrow').should('contain.text', '$(34000%)dx')
cy.get('#\\/m2 .mjx-mrow').should('contain.text', '34,0dx')
cy.get('#\\/m3 .mjx-mrow').should('contain.text', '34000')

cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();
expect(stateVariables["/mi1"].stateValues.value).eq('\uff3f')
expect(stateVariables["/mi1"].stateValues.value).eqls(['unit', '$', ['*', ['unit', 34000, '%'], "d", "x"]])
expect(stateVariables["/mi2"].stateValues.value).eqls(["list", 34, ["*", 0, "d", "x"]])
expect(stateVariables["/mi3"].stateValues.value).eq(34000)
});
Expand Down
Loading