Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into newHomepage
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincharles committed Feb 27, 2023
2 parents e2e0d15 + ff5bfe2 commit a5e544a
Show file tree
Hide file tree
Showing 52 changed files with 1,872 additions and 893 deletions.
10 changes: 7 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,22 @@
"postStartCommand": "npx snowpack dev",

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
"remoteUser": "root",
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"ms-azuretools.vscode-docker",
"esbenp.prettier-vscode",
"styled-components.vscode-styled-components",
"meganrogge.template-string-converter"
"meganrogge.template-string-converter",
"GitHub.vscode-pull-request-github",
"eamodio.gitlens",
"DotJoshJohnson.xml"
],
"settings": {
"editor.formatOnSave": true
"editor.formatOnSave": true,
"extensions.verifySignature": false
}
}
}
Expand Down
46 changes: 46 additions & 0 deletions cypress/e2e/DoenetML/tagSpecific/angle.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2244,4 +2244,50 @@ describe('Angle Tag Tests', function () {

})

it('emphasize right angle', () => {
cy.window().then(async (win) => {
win.postMessage({
doenetML: `
<graph>
<angle name="a1" through="(-5,0) (0,0) (0,-5)" />
<angle name="a2" through="(5,0) (0,0) (0,-5)" emphasizeRightAngle="false" />
<angle name="a3" through="(5,0) (0,0) (0,5)" emphasizeRightAngle="$bi3" />
</graph>
<p>Emphasize right angle 1: <booleanInput name="bi1" bindValueTo="$a1.emphasizeRightAngle" /></p>
<p>Emphasize right angle 2: <booleanInput name="bi2" bindValueTo="$a2.emphasizeRightAngle" /></p>
<p>Emphasize right angle 3: <booleanInput name="bi3" /></p>
<p name="emphasize">Emphasize right angle: $a1.emphasizeRightAngle, $a2.emphasizeRightAngle, $a3.emphasizeRightAngle</p>
`}, "*");
});

// TODO: How to check renderer itself?

cy.get('#\\/emphasize').should("have.text", "Emphasize right angle: true, false, false");

cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();
expect(stateVariables['/a1'].stateValues.emphasizeRightAngle).eq(true);
expect(stateVariables['/a2'].stateValues.emphasizeRightAngle).eq(false);
expect(stateVariables['/a3'].stateValues.emphasizeRightAngle).eq(false);
})

cy.get('#\\/bi1').click();
cy.get('#\\/bi2').click();
cy.get('#\\/bi3').click();


cy.get('#\\/emphasize').should("have.text", "Emphasize right angle: false, true, true");

cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();
expect(stateVariables['/a1'].stateValues.emphasizeRightAngle).eq(false);
expect(stateVariables['/a2'].stateValues.emphasizeRightAngle).eq(true);
expect(stateVariables['/a3'].stateValues.emphasizeRightAngle).eq(true);
})

})

});
44 changes: 44 additions & 0 deletions cypress/e2e/DoenetML/tagSpecific/answer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21963,4 +21963,48 @@ describe('Answer Tag Tests', function () {

});

it('a function defined by formula uses formula for a response', () => {
cy.window().then(async (win) => {
win.postMessage({
doenetML: `
<text>a</text>
<p>Type the function <m>f(x) = <function name="correctFunction">x^2</function></m></p>
<p><m>f(x) = </m><mathInput name="userFormula"/></p>

<answer>
<award>
<when>$userFormula = $correctFunction</when>
</award>
</answer>

<p>Submitted responses: <copy prop="submittedResponses" source="_answer1" assignNames="sr1 sr2" /></p>

`}, "*");
});


cy.get("#\\/_p1").should("contain.text", "Type the function");


cy.get("#\\/userFormula textarea").type("x^2{enter}", { force: true });

cy.get("#\\/_answer1_submit").click();

cy.get("#\\/_answer1_correct").should("be.visible");

cy.get("#\\/sr1 .mjx-mrow").eq(0).should("have.text", "x2");
cy.get("#\\/sr2 .mjx-mrow").eq(0).should("have.text", "x2");

cy.get("#\\/userFormula textarea").type("{home}3{enter}", { force: true });

cy.get("#\\/_answer1_submit").click();

cy.get("#\\/_answer1_incorrect").should("be.visible");

cy.get("#\\/sr1 .mjx-mrow").eq(0).should("have.text", "3x2");
cy.get("#\\/sr2 .mjx-mrow").eq(0).should("have.text", "x2");


});

})
Loading

0 comments on commit a5e544a

Please sign in to comment.