Compare commits
31 Commits
open-relea
...
farhaan/ma
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b06315373b | ||
|
|
e458d6fb05 | ||
|
|
515307c923 | ||
|
|
e57cab41e5 | ||
|
|
957991d472 | ||
|
|
f72faa824c | ||
|
|
6d21cbb616 | ||
|
|
de445a97be | ||
|
|
570e843fd4 | ||
|
|
e803c818ab | ||
|
|
7a0483a896 | ||
|
|
201584a7ea | ||
|
|
c222bec9ec | ||
|
|
215662ba16 | ||
|
|
cf5e1a65bf | ||
|
|
e08dc1ddc3 | ||
|
|
3d2dd5006a | ||
|
|
694b1a75fc | ||
|
|
eff1ac0900 | ||
|
|
918463de91 | ||
|
|
a2d119aa43 | ||
|
|
ccb7865100 | ||
|
|
997d205ac6 | ||
|
|
13433e969f | ||
|
|
c21a81eb55 | ||
|
|
9675a6e9a9 | ||
|
|
d9a0a11936 | ||
|
|
13a19a274c | ||
|
|
f4edf956bb | ||
|
|
c3c328fddb | ||
|
|
18cede45a6 |
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Adding new check for github-actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
33
.github/renovate.json
vendored
Normal file
33
.github/renovate.json
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"extends": [
|
||||
"config:base",
|
||||
"schedule:weekly",
|
||||
":automergeLinters",
|
||||
":automergeMinor",
|
||||
":automergeTesters",
|
||||
":enableVulnerabilityAlerts",
|
||||
":rebaseStalePrs",
|
||||
":semanticCommits",
|
||||
":updateNotScheduled"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchDepTypes": [
|
||||
"devDependencies"
|
||||
],
|
||||
"matchUpdateTypes": [
|
||||
"lockFileMaintenance",
|
||||
"minor",
|
||||
"patch",
|
||||
"pin"
|
||||
],
|
||||
"automerge": true
|
||||
},
|
||||
{
|
||||
"matchPackagePatterns": ["@edx", "@openedx"],
|
||||
"matchUpdateTypes": ["minor", "patch"],
|
||||
"automerge": true
|
||||
}
|
||||
],
|
||||
"timezone": "America/New_York"
|
||||
}
|
||||
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@@ -10,19 +10,16 @@ on:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Nodejs Env
|
||||
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Nodejs
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VER }}
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
@@ -43,11 +40,14 @@ jobs:
|
||||
run: npm run build
|
||||
|
||||
- name: Run Coverage
|
||||
uses: codecov/codecov-action@v2
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
fail_ci_if_error: true
|
||||
|
||||
- name: Send failure notification
|
||||
if: ${{ failure() }}
|
||||
uses: dawidd6/action-send-mail@v3
|
||||
uses: dawidd6/action-send-mail@v4
|
||||
with:
|
||||
server_address: email-smtp.us-east-1.amazonaws.com
|
||||
server_port: 465
|
||||
|
||||
2
.github/workflows/lockfileversion-check.yml
vendored
2
.github/workflows/lockfileversion-check.yml
vendored
@@ -10,4 +10,4 @@ on:
|
||||
|
||||
jobs:
|
||||
version-check:
|
||||
uses: openedx/.github/.github/workflows/lockfile-check.yml@master
|
||||
uses: openedx/.github/.github/workflows/lockfileversion-check-v3.yml@master
|
||||
|
||||
36
.github/workflows/npm-publish.yml
vendored
36
.github/workflows/npm-publish.yml
vendored
@@ -1,36 +0,0 @@
|
||||
name: Release CI
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Nodejs Env
|
||||
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ env.NODE_VER }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Create Build
|
||||
run: npm run build
|
||||
|
||||
- name: Release Package
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
|
||||
run: npm semantic-release
|
||||
27
.releaserc
27
.releaserc
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"branch": "master",
|
||||
"tagFormat": "v${version}",
|
||||
"verifyConditions": [
|
||||
"@semantic-release/npm",
|
||||
{
|
||||
"path": "@semantic-release/github",
|
||||
"assets": {
|
||||
"path": "dist/*"
|
||||
}
|
||||
}
|
||||
],
|
||||
"analyzeCommits": "@semantic-release/commit-analyzer",
|
||||
"generateNotes": "@semantic-release/release-notes-generator",
|
||||
"prepare": "@semantic-release/npm",
|
||||
"publish": [
|
||||
"@semantic-release/npm",
|
||||
{
|
||||
"path": "@semantic-release/github",
|
||||
"assets": {
|
||||
"path": "dist/*"
|
||||
}
|
||||
}
|
||||
],
|
||||
"success": [],
|
||||
"fail": []
|
||||
}
|
||||
13
catalog-info.yaml
Normal file
13
catalog-info.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
# This file records information about this repo. Its use is described in OEP-55:
|
||||
# https://open-edx-proposals.readthedocs.io/en/latest/processes/oep-0055-proc-project-maintainers.html
|
||||
apiVersion: backstage.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: "frontend-app-gradebook"
|
||||
description: "The frontend (MFE) for Open edX Gradebook"
|
||||
annotations:
|
||||
openedx.org/arch-interest-groups: ""
|
||||
spec:
|
||||
owner: user:farhaanbukhsh
|
||||
type: 'website'
|
||||
lifecycle: 'experimental'
|
||||
16419
package-lock.json
generated
16419
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
23
package.json
23
package.json
@@ -29,18 +29,18 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
|
||||
"@edx/frontend-component-header": "^5.0.2",
|
||||
"@edx/frontend-platform": "^7.1.0",
|
||||
"@edx/frontend-component-header": "^5.6.0",
|
||||
"@edx/frontend-platform": "8.0.0",
|
||||
"@edx/openedx-atlas": "^0.6.0",
|
||||
"@edx/react-unit-test-utils": "^2.0.0",
|
||||
"@openedx/frontend-plugin-framework": "^1.1.2",
|
||||
"@openedx/frontend-slot-footer": "^1.0.2",
|
||||
"@openedx/paragon": "^22.1.1",
|
||||
"@edx/react-unit-test-utils": "^3.0.0",
|
||||
"@edx/reactifex": "^2.1.1",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.25",
|
||||
"@fortawesome/free-brands-svg-icons": "^5.11.2",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.11.2",
|
||||
"@fortawesome/react-fontawesome": "^0.1.5",
|
||||
"@openedx/frontend-plugin-framework": "^1.2.1",
|
||||
"@openedx/frontend-slot-footer": "^1.0.2",
|
||||
"@openedx/paragon": "^22.1.1",
|
||||
"@redux-beacon/segment": "^1.0.0",
|
||||
"@reduxjs/toolkit": "^1.5.1",
|
||||
"classnames": "^2.2.6",
|
||||
@@ -68,19 +68,16 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@edx/browserslist-config": "^1.1.1",
|
||||
"@openedx/frontend-build": "^13.0.28",
|
||||
"@openedx/frontend-build": "14.0.3",
|
||||
"@testing-library/react": "12.1.5",
|
||||
"axios": "0.21.2",
|
||||
"axios-mock-adapter": "^1.17.0",
|
||||
"es-check": "^2.3.0",
|
||||
"fetch-mock": "^6.5.2",
|
||||
"fetch-mock": "^12.2.0",
|
||||
"husky": "2.7.0",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"jest": "^26.6.3",
|
||||
"jest": "^29.7.0",
|
||||
"react-dev-utils": "^12.0.1",
|
||||
"react-test-renderer": "17.0.2",
|
||||
"reactifex": "1.1.1",
|
||||
"redux-mock-store": "^1.5.3",
|
||||
"semantic-release": "^19.0.3"
|
||||
"redux-mock-store": "^1.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`HistoryTable component snapshot history table data (from bulkManagementHistory.map(this.formatHistoryRow) snapshot: maps resultsSummay to ResultsSummary, wraps filename and user, forwards the rest 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
[
|
||||
{
|
||||
"filename": <span
|
||||
className="wrap-text-in-cell"
|
||||
>
|
||||
@@ -20,7 +20,7 @@ Array [
|
||||
Eifel
|
||||
</span>,
|
||||
},
|
||||
Object {
|
||||
{
|
||||
"filename": <span
|
||||
className="wrap-text-in-cell"
|
||||
>
|
||||
@@ -45,26 +45,26 @@ exports[`HistoryTable component snapshot snapshot - loads formatted table 1`] =
|
||||
<DataTable
|
||||
className="table-striped"
|
||||
columns={
|
||||
Array [
|
||||
Object {
|
||||
[
|
||||
{
|
||||
"Header": "Gradebook",
|
||||
"accessor": "filename",
|
||||
"columnSortable": false,
|
||||
"width": "col-5",
|
||||
},
|
||||
Object {
|
||||
{
|
||||
"Header": "Download Summary",
|
||||
"accessor": "resultsSummary",
|
||||
"columnSortable": false,
|
||||
"width": "col",
|
||||
},
|
||||
Object {
|
||||
{
|
||||
"Header": "Who",
|
||||
"accessor": "user",
|
||||
"columnSortable": false,
|
||||
"width": "col-1",
|
||||
},
|
||||
Object {
|
||||
{
|
||||
"Header": "When",
|
||||
"accessor": "timeUploaded",
|
||||
"columnSortable": false,
|
||||
@@ -73,8 +73,8 @@ exports[`HistoryTable component snapshot snapshot - loads formatted table 1`] =
|
||||
]
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
[
|
||||
{
|
||||
"filename": <span
|
||||
className="wrap-text-in-cell"
|
||||
>
|
||||
@@ -92,7 +92,7 @@ exports[`HistoryTable component snapshot snapshot - loads formatted table 1`] =
|
||||
Eifel
|
||||
</span>,
|
||||
},
|
||||
Object {
|
||||
{
|
||||
"filename": <span
|
||||
className="wrap-text-in-cell"
|
||||
>
|
||||
|
||||
@@ -4,8 +4,8 @@ exports[`ResultsSummary component snapshot - safe hyperlink with bulkGradesUrl w
|
||||
<Hyperlink
|
||||
destination="www.edx.org"
|
||||
href={
|
||||
Object {
|
||||
"url": Object {
|
||||
{
|
||||
"url": {
|
||||
"rowId": 42,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ exports[`AssignmentFilter component render snapshot 1`] = `
|
||||
label="Assignment"
|
||||
onChange={[MockFunction]}
|
||||
options={
|
||||
Array [
|
||||
[
|
||||
<option
|
||||
value=""
|
||||
>
|
||||
|
||||
@@ -10,7 +10,7 @@ exports[`AssignmentFilterType component render snapshot 1`] = `
|
||||
label="Assignment Types"
|
||||
onChange={[MockFunction]}
|
||||
options={
|
||||
Array [
|
||||
[
|
||||
<option
|
||||
value=""
|
||||
>
|
||||
|
||||
@@ -7,7 +7,7 @@ exports[`StudentGroupsFilter component render snapshot 1`] = `
|
||||
label="Tracks"
|
||||
onChange={[MockFunction]}
|
||||
options={
|
||||
Array [
|
||||
[
|
||||
<option
|
||||
value="Track-All"
|
||||
>
|
||||
@@ -43,7 +43,7 @@ exports[`StudentGroupsFilter component render snapshot 1`] = `
|
||||
label="Cohorts"
|
||||
onChange={[MockFunction]}
|
||||
options={
|
||||
Array [
|
||||
[
|
||||
<option
|
||||
value="Cohort-All"
|
||||
>
|
||||
|
||||
@@ -6,7 +6,7 @@ exports[`BulkManagementControls render snapshot - show - network and import butt
|
||||
>
|
||||
<NetworkButton
|
||||
label={
|
||||
Object {
|
||||
{
|
||||
"defaultMessage": "Download Grades",
|
||||
"description": "A labeled button that allows an admin user to download course grades all at once (in bulk).",
|
||||
"id": "gradebook.GradesView.BulkManagementControls.bulkManagementLabel",
|
||||
|
||||
@@ -5,7 +5,7 @@ exports[`AdjustedGradeInput component render snapshot 1`] = `
|
||||
<Form.Control
|
||||
name="adjustedGradeValue"
|
||||
onChange={[MockFunction hook.onChange]}
|
||||
type="text"
|
||||
type="number"
|
||||
value="test-value"
|
||||
/>
|
||||
some-hint-text
|
||||
|
||||
@@ -15,6 +15,7 @@ const useAdjustedGradeInputData = () => {
|
||||
value,
|
||||
onChange,
|
||||
hintText,
|
||||
possibleGrade,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ import React from 'react';
|
||||
|
||||
import { Form } from '@openedx/paragon';
|
||||
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import useAdjustedGradeInputData from './hooks';
|
||||
import messages from '../messages';
|
||||
|
||||
/**
|
||||
* <AdjustedGradeInput />
|
||||
@@ -14,16 +16,18 @@ export const AdjustedGradeInput = () => {
|
||||
value,
|
||||
onChange,
|
||||
hintText,
|
||||
possibleGrade,
|
||||
} = useAdjustedGradeInputData();
|
||||
const { formatMessage } = useIntl();
|
||||
return (
|
||||
<span>
|
||||
<Form.Control
|
||||
type="text"
|
||||
type="number"
|
||||
name="adjustedGradeValue"
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
/>
|
||||
{hintText}
|
||||
{value > possibleGrade ? <div style={{ color: 'red' }}>{ formatMessage(messages.adjustedGradeError, { possibleGrade })}</div> : hintText}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -4,22 +4,22 @@ exports[`OverrideTable component render snapshot 1`] = `
|
||||
<DataTable
|
||||
columns="test-columns"
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
[
|
||||
{
|
||||
"test": "data",
|
||||
},
|
||||
Object {
|
||||
{
|
||||
"andOther": "test-data",
|
||||
},
|
||||
Object {
|
||||
{
|
||||
"adjustedGrade": <AdjustedGradeInput />,
|
||||
"date": Object {
|
||||
"date": {
|
||||
"formatted": 2000-01-01T00:00:00.000Z,
|
||||
},
|
||||
"reason": <ReasonInput />,
|
||||
},
|
||||
]
|
||||
}
|
||||
itemCount={2}
|
||||
itemCount={3}
|
||||
/>
|
||||
`;
|
||||
|
||||
@@ -20,18 +20,20 @@ export const OverrideTable = () => {
|
||||
|
||||
if (hide) { return null; }
|
||||
|
||||
const tableData = [
|
||||
...data,
|
||||
{
|
||||
adjustedGrade: <AdjustedGradeInput />,
|
||||
date: formatDateForDisplay(new Date()),
|
||||
reason: <ReasonInput />,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<DataTable
|
||||
columns={columns}
|
||||
data={[
|
||||
...data,
|
||||
{
|
||||
adjustedGrade: <AdjustedGradeInput />,
|
||||
date: formatDateForDisplay(new Date()),
|
||||
reason: <ReasonInput />,
|
||||
},
|
||||
]}
|
||||
itemCount={data.length}
|
||||
data={tableData}
|
||||
itemCount={tableData.length}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -21,6 +21,11 @@ const messages = defineMessages({
|
||||
defaultMessage: 'Reason',
|
||||
description: 'Edit Modal Override Table Reason column header',
|
||||
},
|
||||
adjustedGradeError: {
|
||||
id: 'gradebook.GradesView.EditModal.Overrides.adjustedGradeError',
|
||||
defaultMessage: 'The value exceeds the maximum grade: {possibleGrade}',
|
||||
description: 'Edit Modal Override Adjusted Grade Error',
|
||||
},
|
||||
});
|
||||
|
||||
export default messages;
|
||||
|
||||
@@ -36,6 +36,7 @@ exports[`EditModal component render with error snapshot 1`] = `
|
||||
Cancel
|
||||
</ModalDialog.CloseButton>
|
||||
<Button
|
||||
disabled={false}
|
||||
onClick={[MockFunction hooks.handleAdjustedGradeClick]}
|
||||
variant="primary"
|
||||
>
|
||||
@@ -80,6 +81,7 @@ exports[`EditModal component render without error snapshot 1`] = `
|
||||
Cancel
|
||||
</ModalDialog.CloseButton>
|
||||
<Button
|
||||
disabled={false}
|
||||
onClick={[MockFunction hooks.handleAdjustedGradeClick]}
|
||||
variant="primary"
|
||||
>
|
||||
|
||||
@@ -12,6 +12,7 @@ import OverrideTable from './OverrideTable';
|
||||
import ModalHeaders from './ModalHeaders';
|
||||
import useEditModalData from './hooks';
|
||||
import messages from './messages';
|
||||
import useAdjustedGradeInputData from './OverrideTable/AdjustedGradeInput/hooks';
|
||||
|
||||
/**
|
||||
* <EditModal />
|
||||
@@ -30,6 +31,10 @@ export const EditModal = () => {
|
||||
handleAdjustedGradeClick,
|
||||
isOpen,
|
||||
} = useEditModalData();
|
||||
const {
|
||||
value,
|
||||
possibleGrade,
|
||||
} = useAdjustedGradeInputData();
|
||||
|
||||
return (
|
||||
<ModalDialog
|
||||
@@ -57,7 +62,7 @@ export const EditModal = () => {
|
||||
<ModalDialog.CloseButton variant="tertiary">
|
||||
{formatMessage(messages.closeText)}
|
||||
</ModalDialog.CloseButton>
|
||||
<Button variant="primary" onClick={handleAdjustedGradeClick}>
|
||||
<Button variant="primary" onClick={handleAdjustedGradeClick} disabled={value > possibleGrade}>
|
||||
{formatMessage(messages.saveGrade)}
|
||||
</Button>
|
||||
</ActionRow>
|
||||
|
||||
@@ -14,10 +14,12 @@ import OverrideTable from './OverrideTable';
|
||||
import useEditModalData from './hooks';
|
||||
import EditModal from '.';
|
||||
import messages from './messages';
|
||||
import useAdjustedGradeInputData from './OverrideTable/AdjustedGradeInput/hooks';
|
||||
|
||||
jest.mock('./hooks', () => jest.fn());
|
||||
jest.mock('./ModalHeaders', () => 'ModalHeaders');
|
||||
jest.mock('./OverrideTable', () => 'OverrideTable');
|
||||
jest.mock('./OverrideTable/AdjustedGradeInput/hooks', () => jest.fn());
|
||||
|
||||
const hookProps = {
|
||||
onClose: jest.fn().mockName('hooks.onClose'),
|
||||
@@ -27,6 +29,12 @@ const hookProps = {
|
||||
};
|
||||
useEditModalData.mockReturnValue(hookProps);
|
||||
|
||||
const adjustedGradeProps = {
|
||||
value: 50,
|
||||
possibleGrade: 100,
|
||||
};
|
||||
useAdjustedGradeInputData.mockReturnValue(adjustedGradeProps);
|
||||
|
||||
let el;
|
||||
describe('EditModal component', () => {
|
||||
beforeEach(() => {
|
||||
@@ -39,6 +47,7 @@ describe('EditModal component', () => {
|
||||
});
|
||||
it('initializes component hooks', () => {
|
||||
expect(useEditModalData).toHaveBeenCalled();
|
||||
expect(useAdjustedGradeInputData).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
describe('render', () => {
|
||||
@@ -88,16 +97,18 @@ describe('EditModal component', () => {
|
||||
expect(button.children[0].el).toEqual(formatMessage(messages.closeText));
|
||||
expect(button.type).toEqual('ModalDialog.CloseButton');
|
||||
});
|
||||
test('adjusted grade button', () => {
|
||||
test('adjusted grade button enabled', () => {
|
||||
const button = footer[1].findByType(ActionRow)[0].children[1];
|
||||
expect(button.children[0].el).toEqual(formatMessage(messages.saveGrade));
|
||||
expect(button.type).toEqual('Button');
|
||||
expect(button.props.onClick).toEqual(hookProps.handleAdjustedGradeClick);
|
||||
expect(button.props.disabled).toEqual(false);
|
||||
});
|
||||
};
|
||||
describe('without error', () => {
|
||||
beforeEach(() => {
|
||||
useEditModalData.mockReturnValueOnce({ ...hookProps, error: undefined });
|
||||
useAdjustedGradeInputData.mockReturnValueOnce({ value: 50, possibleGrade: 100 });
|
||||
el = shallow(<EditModal />);
|
||||
});
|
||||
test('snapshot', () => {
|
||||
@@ -124,5 +135,15 @@ describe('EditModal component', () => {
|
||||
});
|
||||
testFooter();
|
||||
});
|
||||
describe('when the adjusted grade button is disabled', () => {
|
||||
beforeEach(() => {
|
||||
useAdjustedGradeInputData.mockReturnValueOnce({ value: 101, possibleGrade: 100 });
|
||||
el = shallow(<EditModal />);
|
||||
});
|
||||
test('adjusted grade button is disabled', () => {
|
||||
const button = el.instance.findByType(ActionRow)[0].children[1];
|
||||
expect(button.props.disabled).toEqual(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,8 +19,8 @@ exports[`FilterBadge render do not hide value snapshot 1`] = `
|
||||
aria-label="close"
|
||||
className="btn-info"
|
||||
onClick={
|
||||
Object {
|
||||
"handleClose": Array [
|
||||
{
|
||||
"handleClose": [
|
||||
"some",
|
||||
"filters",
|
||||
],
|
||||
@@ -55,8 +55,8 @@ exports[`FilterBadge render hide Value snapshot 1`] = `
|
||||
aria-label="close"
|
||||
className="btn-info"
|
||||
onClick={
|
||||
Object {
|
||||
"handleClose": Array [
|
||||
{
|
||||
"handleClose": [
|
||||
"some",
|
||||
"filters",
|
||||
],
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
exports[`FilteredUsersLabel component render snapshot 1`] = `
|
||||
<format-message-function
|
||||
message={
|
||||
Object {
|
||||
{
|
||||
"defaultMessage": "Showing {filteredUsers} of {totalUsers} total learners",
|
||||
"description": "Users visibility label",
|
||||
"id": "gradebook.GradesTab.usersVisibilityLabel",
|
||||
}
|
||||
}
|
||||
values={
|
||||
Object {
|
||||
{
|
||||
"filteredUsers": <BoldText
|
||||
text={100}
|
||||
/>,
|
||||
|
||||
@@ -28,32 +28,32 @@ exports[`Gradebook Table Fields Username with external_user_key snapshot 1`] = `
|
||||
`;
|
||||
|
||||
exports[`Gradebook Table Fields Username with external_user_key wraps external user key and username 1`] = `
|
||||
Object {
|
||||
"children": Array [
|
||||
Object {
|
||||
"children": Array [
|
||||
Object {
|
||||
"children": Array [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
"MyNameFromHere",
|
||||
],
|
||||
"props": Object {},
|
||||
"props": {},
|
||||
"type": "div",
|
||||
},
|
||||
Object {
|
||||
"children": Array [
|
||||
{
|
||||
"children": [
|
||||
"My name from another land",
|
||||
],
|
||||
"props": Object {
|
||||
"props": {
|
||||
"className": "student-key",
|
||||
},
|
||||
"type": "div",
|
||||
},
|
||||
],
|
||||
"props": Object {},
|
||||
"props": {},
|
||||
"type": "div",
|
||||
},
|
||||
],
|
||||
"props": Object {
|
||||
"props": {
|
||||
"className": "wrap-text-in-cell",
|
||||
},
|
||||
"type": "span",
|
||||
|
||||
@@ -32,7 +32,7 @@ exports[`LabelReplacements TotalGradeLabelReplacement snapshot 1`] = `
|
||||
}
|
||||
placement="left"
|
||||
trigger={
|
||||
Array [
|
||||
[
|
||||
"hover",
|
||||
"focus",
|
||||
]
|
||||
@@ -84,7 +84,7 @@ exports[`snapshot left to right overlay placement 1`] = `
|
||||
}
|
||||
placement="right"
|
||||
trigger={
|
||||
Array [
|
||||
[
|
||||
"hover",
|
||||
"focus",
|
||||
]
|
||||
@@ -118,7 +118,7 @@ exports[`snapshot right to left overlay placement 1`] = `
|
||||
}
|
||||
placement="left"
|
||||
trigger={
|
||||
Array [
|
||||
[
|
||||
"hover",
|
||||
"focus",
|
||||
]
|
||||
|
||||
@@ -7,13 +7,13 @@ exports[`GradebookTable snapshot 1`] = `
|
||||
<DataTable
|
||||
RowStatusComponent={[MockFunction hooks.nullMethod]}
|
||||
columns={
|
||||
Array [
|
||||
[
|
||||
"some",
|
||||
"columns",
|
||||
]
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
[
|
||||
"some",
|
||||
"data",
|
||||
]
|
||||
|
||||
@@ -41,7 +41,7 @@ exports[`ImportGradesButton component render snapshot 1`] = `
|
||||
className="import-grades-btn"
|
||||
import={true}
|
||||
label={
|
||||
Object {
|
||||
{
|
||||
"defaultMessage": "Import Grades",
|
||||
"description": "A labeled button to import grades in the BulkManagement Tab File Upload Form",
|
||||
"id": "gradebook.GradesView.importGradesBtnText",
|
||||
|
||||
@@ -17,7 +17,7 @@ exports[`InterventionsReport component output snapshot 1`] = `
|
||||
</div>
|
||||
<NetworkButton
|
||||
label={
|
||||
Object {
|
||||
{
|
||||
"defaultMessage": "Download Interventions",
|
||||
"description": "The labeled button to download the Intervention report from the Grades View",
|
||||
"id": "gradebook.GradesView.InterventionsReport.downloadBtn",
|
||||
|
||||
@@ -4,7 +4,7 @@ exports[`PageButtons component render snapshot 1`] = `
|
||||
<div
|
||||
className="d-flex justify-content-center"
|
||||
style={
|
||||
Object {
|
||||
{
|
||||
"paddingBottom": "20px",
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ exports[`PageButtons component render snapshot 1`] = `
|
||||
disabled="prev-disabled"
|
||||
onClick={[MockFunction hooks.prev.onClick]}
|
||||
style={
|
||||
Object {
|
||||
{
|
||||
"margin": "20px",
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ exports[`PageButtons component render snapshot 1`] = `
|
||||
disabled="next-disabled"
|
||||
onClick={[MockFunction hooks.next.onClick]}
|
||||
style={
|
||||
Object {
|
||||
{
|
||||
"margin": "20px",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@ exports[`NetworkButton component snapshots snapshot 1`] = `
|
||||
<StatefulButton
|
||||
className="ml-2 test-class"
|
||||
disabledStates={
|
||||
Array [
|
||||
[
|
||||
"pending",
|
||||
]
|
||||
}
|
||||
icons={
|
||||
Object {
|
||||
{
|
||||
"default": <Icon
|
||||
className="fa mr-2 fa-download"
|
||||
/>,
|
||||
@@ -19,7 +19,7 @@ exports[`NetworkButton component snapshots snapshot 1`] = `
|
||||
}
|
||||
}
|
||||
labels={
|
||||
Object {
|
||||
{
|
||||
"default": <FormattedMessage
|
||||
defaultMessage="test button label"
|
||||
description="test button label description"
|
||||
|
||||
@@ -87,15 +87,16 @@ describe('root selectors', () => {
|
||||
});
|
||||
});
|
||||
describe('if neither/only 1 are default values', () => {
|
||||
beforeEach(() => {
|
||||
filterConstants.filterConfig[filterName] = testConfig;
|
||||
config = selectors.root.filterBadgeConfig(testState, filterName);
|
||||
});
|
||||
describe.each([
|
||||
['neither', () => false],
|
||||
['only filter1', (v) => v === filters[0]],
|
||||
['only filter2', (v) => v === filters[1]],
|
||||
], '%1 is default', (label, isDefaultFn) => {
|
||||
beforeEach(() => {
|
||||
filterConstants.filterConfig[filterName] = testConfig;
|
||||
config = selectors.root.filterBadgeConfig(testState, filterName);
|
||||
});
|
||||
|
||||
it('returns isDefault: false, string value, and remaining filterConfig', () => {
|
||||
selectors.filters.isDefault.mockImplementation(isDefaultFn);
|
||||
const { filterOrder, ...rest } = testConfig;
|
||||
|
||||
Reference in New Issue
Block a user