Skip to content

Commit

Permalink
merging in vite-bugfix
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit c2f29cc
Merge: 9d23ae5 7cab3f6
Author: Kevin Charles <[email protected]>
Date:   Fri Apr 7 13:37:58 2023 -0500

    Merge pull request Doenet#5 from Lyanthropos/deployVite2

    update with vite-bugfix

commit 7cab3f6
Merge: cfd2ab8 9d23ae5
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 13:07:17 2023 -0500

    Merge remote-tracking branch 'Kevin/deployVite2' into deployVite2

commit cfd2ab8
Merge: 7001361 33c4426
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 18:06:55 2023 +0000

    Merge remote-tracking branch 'Emilio/vite-bugfix' into deployVite2

commit 33c4426
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:25:24 2023 +0000

    increase default node space size

commit 0875f63
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:04:13 2023 +0000

    move geogebra to public (references)

commit 6c191f8
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:03:48 2023 +0000

    move geogebra to public (files)

commit e668f5a
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:00:22 2023 +0000

    explicit worker module type

commit 87fc436
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 00:59:05 2023 +0000

    add cache to gitnore

commit 578f693
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 00:58:50 2023 +0000

    update commands

commit 825f7e5
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 00:58:27 2023 +0000

    add gnome-keyring

commit 5012664
Merge: b6eabed 8c19893
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 10:23:22 2023 -0500

    Merge branch 'main' into vite-bugfix

commit b6eabed
Merge: a95e754 bd04a17
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 15:19:21 2023 +0000

    Merge remote-tracking branch 'Doenet/main' into vite-bugfix

commit a95e754
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 15:18:55 2023 +0000

    inlcude plotly

commit bcebb93
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 15:12:56 2023 +0000

    increase npm build space to 4gb

commit 8c19893
Author: Duane Nykamp <[email protected]>
Date:   Mon Apr 3 23:17:07 2023 -0500

    graph inside graph renders children inside parent graph (Doenet#2007)

commit 541f71f
Author: Duane Nykamp <[email protected]>
Date:   Mon Apr 3 23:11:54 2023 -0500

    dark mode support in core styles and test environments (Doenet#2006)

commit f5d66b1
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 03:17:16 2023 +0000

    fix geogebra import

commit 8384bab
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 03:15:46 2023 +0000

    switch to import flags

commit bd04a17
Author: Duane Nykamp <[email protected]>
Date:   Mon Apr 3 21:56:09 2023 -0500

    Functions inside functions are reevaluated (Doenet#2002)

    * evaluate_to_constant return NaN for non-numeric
    * Functions default to symbolic
    * Functions default to simplify
    * function simplify/expand do not affect formula

commit fc2fbc3
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 02:55:51 2023 +0000

    fix image imports

commit ed43229
Author: Emilio Alvarez <[email protected]>
Date:   Mon Apr 3 21:11:42 2023 -0500

    upgrade development to vite (Doenet#2008)

commit 6fa3a61
Author: Jason Altekruse <[email protected]>
Date:   Mon Apr 3 10:35:59 2023 -0500

    Upgrade to react 18 (Doenet#1991)

    * Upgrade react 18

    - also update packages with peer dependencies on react
    - delete file not referenced anywhere (it happened to also reference
      a datetime package that has not be updated to be compatible with react
      18, but it doesn't matter because we didn't actually need it)
    - palantir/blueprint#5699

    * package lock

    * Change to use the new API for the root render call reqired in version 18

    * Remove unneeded depedency, move cypress-parallel to optional depedencies

commit 8d61204
Author: Duane Nykamp <[email protected]>
Date:   Thu Mar 30 20:08:25 2023 -0500

    piecewise function (Doenet#1998)

(cherry picked from commit 86f9660)
  • Loading branch information
jaltekruse committed Apr 8, 2023
1 parent 84e6534 commit de26fe7
Show file tree
Hide file tree
Showing 960 changed files with 16,575 additions and 20,685 deletions.
23 changes: 13 additions & 10 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,28 @@

// Uncomment the next line to run commands after the container is created - for example installing curl.
"initializeCommand": "docker compose -f docker-compose.yml -f .devcontainer/docker-compose.extend.yml down",
"postCreateCommand": "npm install",
"postCreateCommand": "npm install && npx vite optimize",
// "postStartCommand": "",

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "root",
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"ms-azuretools.vscode-docker",
"esbenp.prettier-vscode",
"styled-components.vscode-styled-components",
"meganrogge.template-string-converter",
"GitHub.vscode-pull-request-github",
"eamodio.gitlens",
"DotJoshJohnson.xml"
],
"dbaeumer.vscode-eslint",
"ms-azuretools.vscode-docker",
"esbenp.prettier-vscode",
"styled-components.vscode-styled-components",
"meganrogge.template-string-converter",
"GitHub.vscode-pull-request-github",
"eamodio.gitlens",
"DotJoshJohnson.xml",
"wix.vscode-import-cost",
"bmewburn.vscode-intelephense-client"
],
"settings": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"extensions.verifySignature": false
}
}
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/docker-compose.extend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ services:
environment:
- CYPRESS_CACHE_FOLDER=/home/node/workspace/.cache/Cypress
- SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
- NODE_OPTIONS=--max-old-space-size=4098
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
cap_add:
- SYS_PTRACE
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
./.cache/
./.devcontainer/
.env
./.git/
Expand Down
2 changes: 1 addition & 1 deletion cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = defineConfig({
on('task', { queryDb: query => { return queryTestDb(query, config) }, }); //For running sql query
},

baseUrl: 'http://localhost',
baseUrl: 'http://localhost:8000',
},
env: {
db: {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/ActivityViewer/activityVariants.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Activity variants tests', function () {

beforeEach(() => {
cy.clearIndexedDB();
cy.visit('/cypressTest')
cy.visit('/src/Tools/cypressTest/')
})


Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/ActivityViewer/compiledActivity.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Compiled activity tests', function () {

beforeEach(() => {
cy.clearIndexedDB();
cy.visit('/cypressTest')
cy.visit('/src/Tools/cypressTest/')
})


Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/ActivityViewer/relationshipsAmongPages.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Relationships among pages tests', function () {

beforeEach(() => {
cy.clearIndexedDB();
cy.visit('/cypressTest')
cy.visit('/src/Tools/cypressTest/')
})

it("Problem numbering continues across pages", () => {
Expand Down
34 changes: 17 additions & 17 deletions cypress/e2e/AsStudent/assignedActivity.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Assigned Activity Tests', function () {
const doenetId = "activity1id";
const pageDoenetId = "_page1id";

before(()=>{
before(() => {
cy.signin({ userId });
cy.clearAllOfAUsersCoursesAndItems({ userId });
cy.clearAllOfAUsersCoursesAndItems({ userId: studentUserId });
Expand All @@ -16,8 +16,8 @@ describe('Assigned Activity Tests', function () {
cy.clearIndexedDB();
cy.clearAllOfAUsersActivities({ userId });
cy.clearAllOfAUsersActivities({ userId: studentUserId });
cy.createActivity({ courseId, doenetId, parentDoenetId:courseId, pageDoenetId });
cy.visit(`http://localhost/course?tool=editor&doenetId=${doenetId}&pageId=${pageDoenetId}`);
cy.createActivity({ courseId, doenetId, parentDoenetId: courseId, pageDoenetId });
cy.visit(`/course?tool=editor&doenetId=${doenetId}&pageId=${pageDoenetId}`);
})


Expand All @@ -30,12 +30,12 @@ describe('Assigned Activity Tests', function () {

// Formatting the date to be 'mm/dd/yyyy' WITH leading zeros
// Ex: '09/12/2022' for September 12, 2022
function formatDateWithYear(date,prefixZero) {
function formatDateWithYear(date, prefixZero) {
const yyyy = date.getFullYear();
let mm = date.getMonth() + 1; // Months start at 0!
let dd = date.getDate();
if (mm < 10) mm = '0' + mm;
if (prefixZero){
if (prefixZero) {
if (mm < 10) mm = '0' + mm;
if (dd < 10) dd = '0' + dd;
}

Expand All @@ -52,7 +52,7 @@ describe('Assigned Activity Tests', function () {
}

function getDayOfWeek(date) {
const weekday = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
const weekday = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
return weekday[date.getDay()];
}

Expand Down Expand Up @@ -82,30 +82,30 @@ describe('Assigned Activity Tests', function () {
return hr + ':' + min + ' ' + ampm;
}


it('Activity contains due date in Content page', () => {

const assignedDate = new Date();
let dueDate = new Date(assignedDate.getTime() + 7 * 24 * 60 * 60 * 1000); // One week from now
dueDate.setSeconds(0); //To prevent rounding up false tests

// Update the activity as the owner
cy.get('[data-test="AssignmentSettingsMenu Menu"]').click();
cy.get('[data-test="Due Date Checkbox"]').click();
cy.get('[data-test="Due Date"]').should('have.value', formatDateWithYear(dueDate,true) + ' ' + formatTime(dueDate));
cy.get('[data-test="Due Date"]').should('have.value', formatDateWithYear(dueDate, true) + ' ' + formatTime(dueDate));
cy.get('[data-test="Assigned Date Checkbox"]').click();
cy.get('[data-test="Assign Activity"]').click();
cy.get('[data-test="Unassign Activity"]').should('be.visible'); //Wait for activity to be saved

// Sign in as a student
cy.signin({ userId: studentUserId });
cy.visit(`http://localhost/course?tool=navigation&courseId=${courseId}`)
cy.visit(`/course?tool=navigation&courseId=${courseId}`)

// Check if the Content page contains the correct activity with the due date
cy.get('.navigationRow').should('have.length', 1); // Need this to wait for the row to appear
cy.get('[data-test="rowLabel"]').contains('Cypress Activity');
cy.get('.navigationRow').eq(0).get('.navigationColumn2').contains(formatDateWithYear(dueDate,false) + ', ' + formatHours(dueDate) + ':' + formatMinutes(dueDate) + ':00');
cy.get('.navigationRow').eq(0).get('.navigationColumn2').contains(formatDateWithYear(dueDate, false) + ', ' + formatHours(dueDate) + ':' + formatMinutes(dueDate) + ':00');

})


Expand All @@ -117,23 +117,23 @@ describe('Assigned Activity Tests', function () {
// Update the activity as the owner
cy.get('[data-test="AssignmentSettingsMenu Menu"]').click();
cy.get('[data-test="Assigned Date Checkbox"]').click();
cy.get('[data-test="Assigned Date"]').should('have.value', formatDateWithYear(assignedDate,true) + ' ' + formatTime(assignedDate));
cy.get('[data-test="Assigned Date"]').should('have.value', formatDateWithYear(assignedDate, true) + ' ' + formatTime(assignedDate));
cy.get('[data-test="Due Date Checkbox"]').click();
cy.get('[data-test="Due Date"]').should('have.value', formatDateWithYear(dueDate,true) + ' ' + formatTime(dueDate));
cy.get('[data-test="Due Date"]').should('have.value', formatDateWithYear(dueDate, true) + ' ' + formatTime(dueDate));
cy.get('[data-test="Assign Activity"]').click();
cy.get('[data-test="Unassign Activity"]').should('be.visible'); //Wait for activity to be saved


// Sign in as a student
// Check if the Content By Week page contains the correct activity with the assigned date and due date
cy.signin({ userId: studentUserId });
cy.visit(`http://localhost/course?tool=dashboard&courseId=${courseId}`);
cy.visit(`/course?tool=dashboard&courseId=${courseId}`);
cy.get('[data-test="next week button"]').click();
cy.get('table').should('have.length', 1); // Need this to wait for the row to appear
cy.get('[data-test="cbw assignment label 0"]').contains('Cypress Activity');
cy.get('[data-test="cbw assigned date 0"]').contains(formatDateWithoutYear(assignedDate) + ' ' + formatTime(assignedDate)); // Add the 'M' back to AM/PM
cy.get('[data-test="cbw due date 0"]').contains(formatDateWithoutYear(dueDate) + ' ' + formatTime(dueDate));

})

})
13 changes: 6 additions & 7 deletions cypress/e2e/AsStudent/previousAndNext.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('Previous and Next Activty Button Tests', () => {
});
if (isAssigned) {
cy.visit(
`http://localhost/course?tool=editor&doenetId=${doenetId}&pageId=${`_pageDoenetId${i}.1`}`,
`/course?tool=editor&doenetId=${doenetId}&pageId=${`_pageDoenetId${i}.1`}`,
);
cy.get('[data-test="AssignmentSettingsMenu Menu"]')
.should('be.visible')
Expand All @@ -150,7 +150,7 @@ describe('Previous and Next Activty Button Tests', () => {

it('Next button goes to from first to second', () => {
cy.visit(
`http://localhost/course?tool=assignment&doenetId=${genIdsInContnetOrder[0].doenetId}&pageId=${genIdsInContnetOrder[0].firstPageId}`,
`/course?tool=assignment&doenetId=${genIdsInContnetOrder[0].doenetId}&pageId=${genIdsInContnetOrder[0].firstPageId}`,
);
cy.get('[data-test="Previous Activity Button"]').should('be.disabled');
cy.get('[data-test="Next Activity Button"]').should('be.enabled').click();
Expand All @@ -161,7 +161,7 @@ describe('Previous and Next Activty Button Tests', () => {

it('Previous button goes to from second to first', () => {
cy.visit(
`http://localhost/course?tool=assignment&doenetId=${genIdsInContnetOrder[1].doenetId}&pageId=${genIdsInContnetOrder[1].firstPageId}`,
`/course?tool=assignment&doenetId=${genIdsInContnetOrder[1].doenetId}&pageId=${genIdsInContnetOrder[1].firstPageId}`,
);
cy.get('[data-test="Next Activity Button"]').should('be.enabled');
cy.get('[data-test="Previous Activity Button"]')
Expand All @@ -178,15 +178,15 @@ describe('Previous and Next Activty Button Tests', () => {
);
expect(procIdx).to.not.equal(-1);
cy.visit(
`http://localhost/course?tool=assignment&doenetId=${genIdsInContnetOrder[procIdx].doenetId}&pageId=${genIdsInContnetOrder[procIdx].firstPageId}`,
`/course?tool=assignment&doenetId=${genIdsInContnetOrder[procIdx].doenetId}&pageId=${genIdsInContnetOrder[procIdx].firstPageId}`,
);
cy.get('[data-test="Next Activity Button"]').should('be.disabled');
cy.get('[data-test="Previous Activity Button"]').should('be.disabled');
});

it('Next button from first to last, skipping unassigned', () => {
cy.visit(
`http://localhost/course?tool=assignment&doenetId=${genIdsInContnetOrder[0].doenetId}&pageId=${genIdsInContnetOrder[0].firstPageId}`,
`/course?tool=assignment&doenetId=${genIdsInContnetOrder[0].doenetId}&pageId=${genIdsInContnetOrder[0].firstPageId}`,
);
cy.get('[data-test="Previous Activity Button"]').should('be.disabled');
let i;
Expand All @@ -210,8 +210,7 @@ describe('Previous and Next Activty Button Tests', () => {

it('Previous button goes to from last to first, skipping unassigned and proctored', () => {
cy.visit(
`http://localhost/course?tool=assignment&doenetId=${
genIdsInContnetOrder[activityOptions.length - 1].doenetId
`/course?tool=assignment&doenetId=${genIdsInContnetOrder[activityOptions.length - 1].doenetId
}&pageId=${genIdsInContnetOrder[activityOptions.length - 1].firstPageId}`,
);
cy.get('[data-test="Next Activity Button"]').should('be.disabled');
Expand Down
90 changes: 45 additions & 45 deletions cypress/e2e/AsStudent/signIn.cy.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
describe('Student Sign-In Test', function () {
const userId = "cyuserId";
// const studentUserId = "cyStudentUserId";
const courseId = "courseid1";
// const doenetId = "activity1id";
// const pageDoenetId = "_page1id";
before(()=>{
cy.signin({ userId });
cy.clearAllOfAUsersCoursesAndItems({ userId });
const userId = "cyuserId";
// const studentUserId = "cyStudentUserId";
const courseId = "courseid1";
// const doenetId = "activity1id";
// const pageDoenetId = "_page1id";

before(() => {
cy.signin({ userId });
cy.clearAllOfAUsersCoursesAndItems({ userId });
// cy.clearAllOfAUsersCoursesAndItems({ userId: studentUserId });
cy.createCourse({ userId, courseId });
})
beforeEach(() => {
cy.signin({ userId });
cy.clearIndexedDB();
cy.clearAllOfAUsersActivities({ userId });
cy.createCourse({ userId, courseId });
})
beforeEach(() => {
cy.signin({ userId });
cy.clearIndexedDB();
cy.clearAllOfAUsersActivities({ userId });
// cy.clearAllOfAUsersActivities({ userId: studentUserId });
// cy.createActivity({ courseId, doenetId, parentDoenetId:courseId, pageDoenetId });
cy.visit(`http://localhost/course?tool=people&courseId=${courseId}`);
})
Cypress.on('uncaught:exception', (err, runnable) => {
// Returning false here prevents Cypress from failing the test
return false;
})
it('Student can sign in after being added to a course', () => {
const emailAddress = "[email protected]";
cy.get('[data-test="First"]').type("Scooby");
cy.get('[data-test="Last"]').type("Doo");
cy.get('[data-test="Email"]').type(emailAddress);
cy.get('[data-test="Add User"]').click();
cy.visit(`http://localhost/settings`)
cy.get('[data-test="sign out button"]').click();
cy.get('[data-test="homepage button"]').should('be.visible');
cy.visit(`http://localhost/SignIn`)
cy.get('[data-test="email input"]').type(emailAddress);
cy.get('[data-test="sendEmailButton"]').click();
cy.task('queryDb', `SELECT signInCode FROM user_device ORDER BY id DESC LIMIT 1`).then((result)=>{
const code = result[0].signInCode;
cy.get('[data-test="signinCodeInput"]').type(code);
cy.get('[data-test="signInButton"]').click();
cy.get('[data-test="Nav to course"]').should('be.visible');
});
})
cy.visit(`/course?tool=people&courseId=${courseId}`);
})


Cypress.on('uncaught:exception', (err, runnable) => {
// Returning false here prevents Cypress from failing the test
return false;
})


it('Student can sign in after being added to a course', () => {
const emailAddress = "[email protected]";
cy.get('[data-test="First"]').type("Scooby");
cy.get('[data-test="Last"]').type("Doo");
cy.get('[data-test="Email"]').type(emailAddress);
cy.get('[data-test="Add User"]').click();
cy.visit(`/settings`)
cy.get('[data-test="sign out button"]').click();
cy.get('[data-test="homepage button"]').should('be.visible');
cy.visit(`/SignIn`)
cy.get('[data-test="email input"]').type(emailAddress);
cy.get('[data-test="sendEmailButton"]').click();
cy.task('queryDb', `SELECT signInCode FROM user_device ORDER BY id DESC LIMIT 1`).then((result) => {
const code = result[0].signInCode;
cy.get('[data-test="signinCodeInput"]').type(code);
cy.get('[data-test="signInButton"]').click();
cy.get('[data-test="Nav to course"]').should('be.visible');
});

})

})
Loading

0 comments on commit de26fe7

Please sign in to comment.