Skip to content

Commit

Permalink
Merge pull request #760 from SlateFoundation/develop
Browse files Browse the repository at this point in the history
Release: v3.8.8
  • Loading branch information
themightychris authored Jan 30, 2023
2 parents 77a02b0 + e25c0e7 commit c4c948d
Show file tree
Hide file tree
Showing 13 changed files with 1,227 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .holo/sources/slate.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[holosource]
url = "https://github.com/SlateFoundation/slate"
ref = "refs/tags/v2.20.1"
ref = "refs/tags/v2.20.3"
9 changes: 9 additions & 0 deletions cypress/fixtures/cbl/calculations.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,15 @@
"growth": "1.2",
"progress": "63"
}
},
"HW": {
"HW.2": {
"description": "Ratings added after overrides with and without flushing out the override",
"baseline": null,
"average": "8.8",
"growth": "0.8",
"progress": "90"
}
}
}
}
4 changes: 2 additions & 2 deletions cypress/integration/cbl/api/student-competencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ describe('CBL / API / StudentCompetency', () => {
expect(response).property('status').to.eq(200);
expect(response).property('body').to.be.an('object');
expect(response.body).property('success').to.be.true;
expect(response.body).property('total').to.eq(655);
expect(response.body).property('total').to.eq(656);
expect(response.body).property('limit').to.eq(0);
expect(response.body).property('data').to.be.an('array');
expect(response.body.data).to.have.length(655);
expect(response.body.data).to.have.length(656);
expect(response.body.data[0]).to.include({
ID: 584,
Class: 'Slate\\CBL\\StudentCompetency',
Expand Down
98 changes: 98 additions & 0 deletions cypress/integration/cbl/exports/ratings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
const csvtojson = require('csvtojson');

describe('CBL / Exports / Ratings', () => {
let exportedRows;

before(() => {
cy.resetDatabase();
});

it('Download data from CSV export endpoint', () => {
cy.loginAs('admin');

cy.request({
url: '/exports/slate-cbl/demonstrations',
qs: {
students: 'group:class_of_2020'
}
}).then(({ headers, body }) => {
expect(headers).to.have.property('content-type', 'text/csv; charset=utf-8');
return csvtojson().fromString(body);
}).then(rows => {
expect(rows).to.be.an('array').and.have.length(566);

// save to variable declared in global scope of suite
exportedRows = rows;
});
});

it('Has expected column headers', () => {
expect(exportedRows[0]).to.be.an('object').and.have.all.keys(
'Demonstration Skill ID',
'Demonstration ID',
'Student Task ID',
'Teacher ID',
'Teacher Username',
'Teacher Name',
'StudentID',
'Student Number',
'Student Username',
'Student Name',
'Experience Type',
'Course Code',
'Section Code',
'Experience Name',
'Task Title',
'Artifact URL',
'Competency',
'Skill',
'Created',
'Modified',
'Rating',
'Portfolio',
'Term Title',
'Term Handle'
);
});

it('Has expected counts of different ratings and portfolios', () => {
const ratingsCount = {}, portfoliosCount = {};

for (const row of exportedRows) {
// count rating
if (!(row['Rating'] in ratingsCount)) {
ratingsCount[row['Rating']] = 0;
}

ratingsCount[row['Rating']]++;

// count portfolio
if (!(row['Portfolio'] in portfoliosCount)) {
portfoliosCount[row['Portfolio']] = 0;
}

portfoliosCount[row['Portfolio']]++;
}

expect(ratingsCount).to.contain({
'1': 4,
'4': 1,
'5': 17,
'6': 59,
'7': 73,
'8': 63,
'9': 116,
'10': 62,
'11': 44,
'12': 4,
'M': 89,
'O': 34
});

expect(portfoliosCount).to.contain({
'9': 348,
'10': 120,
'11': 98
});
});
});
Loading

0 comments on commit c4c948d

Please sign in to comment.