Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Charles committed Nov 25, 2019
0 parents commit 39d22ee
Show file tree
Hide file tree
Showing 534 changed files with 219,493 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.


# dependencies
/node_modules

# testing
/coverage

# production
/build

# local build files
/dist_local

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.env
.env.development
.env.production

npm-debug.log*
yarn-debug.log*
yarn-error.log*
# package-lock.json

.vscode
src/defaultCode.doenet
#ignore the distribution
# dist/index.html
# dist/main.js
dist_local/*

cypress/videos
cypress/screenshots

src/tempcodes
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# DoenetCore
The core libraries underlying the Distributed Open Education Network (Doenet)
4 changes: 4 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"baseUrl": "http://localhost:3000",
"numTestsKeptInMemory": 1
}
42 changes: 42 additions & 0 deletions cypress/fixtures/courseAssignmentsSeed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"contentSeeds" :{
"branchId": ["a1branchid", "a2branchid", "a3branchid", "b3branchid", "b2branchid"],
"contentId": ["a1contentid", "a2contentid", "a3contentid", "b3contentid", "b2contentid"],
"title": ["a1content", "a2content", "a3content", "b3content", "b2content"],
"doenetML": [
"<title>Assignment A1</title>",
"<title>Assignment A2</title>",
"<title>Assignment A3</title>",
"<title>Assignment B3</title>",
"<title>Assignment B2</title>"
]
},
"assignmentSeeds" : [{
"headingText": "Heading A",
"courseHeadingId": "heading_a_id",
"headingLevel": 1,
"courseId": "aI8sK4vmEhC5sdeSP3vNW",
"documentName" : [ "Assignment A1", "Assignment A2", "Assignment A3"],
"assignmentId" : [ 12246, 12247, 12248],
"creationDate": ["2019-08-20 13:42:56", "2019-08-19 13:42:56", "2019-08-18 13:42:56"],
"assignedDate": ["2019-08-21 13:42:56", "2019-08-22 13:42:56", "2019-08-23 13:42:56"],
"dueDate": ["2019-08-24 13:42:56", "2019-08-23 13:42:56", "2019-08-22 13:42:56"],
"headingId": "heading_a_id",
"branchId": ["a1branchid", "a2branchid", "a3branchid"],
"contentId": ["a1contentid", "a2contentid", "a3contentid"]
},
{
"headingText": "Heading B",
"courseHeadingId": "heading_b_id",
"headingLevel": 1,
"courseId": "aI8sK4vmEhC5sdeSP3vNW",
"documentName" : [ "Assignment B3", "Assignment B2"],
"assignmentId" : [ 13248, 13247],
"creationDate": ["2019-08-25 13:42:56", "2019-08-26 13:42:56"],
"assignedDate": ["2019-08-27 13:42:56", "2019-08-28 13:42:56"],
"dueDate": ["2019-08-29 13:42:56", "2019-08-30 13:42:56"],
"headingId": "heading_b_id",
"branchId": ["b3branchid", "b2branchid"],
"contentId": ["b3contentid", "b2contentid"]
}]
}
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
66 changes: 66 additions & 0 deletions cypress/integration/DoenetChooser/DoenetChooser.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { exportAllDeclaration } from "@babel/types";

describe('DoenetChooser tests', function () {

/*
1. check if publish indication works properly with title changed or just or content
2. check if document title is changed based on the title input
*/
beforeEach(() => {
cy.visit('/chooser')
})

it('chooser item click test', function() {
// item should be selected when clicked
cy.get(':nth-child(2) > .browserItemName').click();
cy.get(':nth-child(2) > .browserItemName').parent().should('have.class', 'browserSelectedRow');
});

it('info panel test', function() {
// info panel should display selected item information
cy.get(':nth-child(2) > .browserItemName').click();
cy.get('.browserSelectedRow > .browserItemName > span').invoke('text')
.then((text1) => {
cy.get('.infoPanelTitle > span').invoke('text').then((text2) => {
expect(text1).eq(text2);
})
})

// edit button should open up editor to edit selected item when clicked
cy.get('[data-cy=editContentButton]').click();
cy.url().should('include', '/editor');
});

it('new document button', function() {
// check if new content menu is visible onclick
cy.get('[data-cy=newContentButton]').click();
cy.get('[data-cy=newContentMenu]').should('be.visible');

// click on anywhere on the screen to close menu
cy.get('.infoPanelTitle').click();
cy.get('[data-cy=newContentMenu]').should('not.be.visible');

// click on new document button
cy.get('[data-cy=newContentButton]').click();
cy.get('[data-cy=newDocumentButton]').click();
cy.url().should('include', '/editor');
});

it('create new course', function() {
cy.get('[data-cy=newContentButton]').click();
cy.get('[data-cy=newCourseButton]').click();
cy.get('#topToolbar > span').contains('Add New Course');

cy.get('[data-cy=newCourseFormNameInput]').type("TestCypressCourseName");
cy.get('[data-cy=newCourseFormDepInput]').type("TestCypressCourseDepartment");
cy.get('[data-cy=newCourseFormCodeInput]').type("TestCypressCourseCode");
cy.get('[data-cy=newCourseFormSectionInput]').type("001");
cy.get('[data-cy=newCourseFormYearInput]').type("2019");
cy.get('[data-cy=newCourseFormDescInput]').type("TestCypressCourseDescription");

cy.get('[data-cy=newCourseFormSubmitButton]').click();

// info panel should display created course info
cy.get('.infoPanelTitle > span').contains("TestCypressCourseName");
});
})
50 changes: 50 additions & 0 deletions cypress/integration/DoenetEditor/DoenetEditor.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
describe('doenetEditor test', function () {

/*
1. check if publish indication works properly with title changed or just or content
2. check if document title is changed based on the title input
*/
beforeEach(() => {
cy.visit('/editor/?branchId=_v6f_8r8-stZd14gT7vkB')
})

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

it('publish button test', function() {
//cy.get('[data-cy=_v6f_8r8-stZd14gT7vkB]').click();
cy.get('[class=ace_content]').get('[class=ace_text-input]').type("4k8ecd8z",{force:true});
cy.get('[data-cy=editorPublishButton]').should('not.be.disabled').click({force:true}).should('be.disabled')

cy.reload()
cy.get('[data-cy=editorPublishButton]').should('be.disabled')

cy.get('[class=ace_content]').get('[class=ace_text-input]').clear({force:true});

cy.get('[class=ace_content]').get('[class=ace_text-input]').type("123this is my testline2line3",{force:true});
cy.get('[data-cy=editorPublishButton]').should('be.disabled')

cy.get('[class=ace_content]').get('[class=ace_text-input]').clear({force:true});

cy.get('[class=ace_content]').get('[class=ace_text-input]').type("this is my testline2line3",{force:true});
cy.get('[data-cy=editorPublishButton]').should('be.disabled')

cy.get('[class=ace_content]').get('[class=ace_text-input]').clear({force:true});
cy.get('[class=ace_content]').get('[class=ace_text-input]').type("abc is my testline2line3",{force:true});
cy.get('[data-cy=editorPublishButton]').should('not.be.disabled')
});
it('title input test', function() {

cy.get('input').clear().type('abc',{force:true})
cy.get('[data-cy=documentTitle]').contains("Document title: abc",{force:true})
cy.get('[data-cy=editorPublishButton]').should('not.be.disabled').click({force:true}).should('be.disabled')
cy.reload()
cy.get('[data-cy=editorPublishButton]').should('be.disabled')
cy.get('[data-cy=documentTitle]').contains("Document title: abc")
});


})
Loading

0 comments on commit 39d22ee

Please sign in to comment.