Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ItemComponent.js
/* globals React */
const shallow = require('enzyme').shallow;
const expect = require('chai').expect;
const setup = require('static/bundles/test/componentSetup');
const courseViewGradeData = require('static/bundles/ondemand/components/__fixtures__/CourseViewGrade.mock');
const courseMaterialData = require('static/bundles/author-grade/stores/__tests__/fixtures/courseMaterialData.newGradeWeights.js');
const beforeEachLoadPromisedObject = require('static/bundles/phoenix/test/lib/beforeEachLoadPromisedObject');
describe.only('ItemComponent', () => {
setup();
let wrapper;
let ItemComponent;
let itemMetadata;
beforeEachLoadPromisedObject('courseMaterials', 'pages/open-course/common/singletons/courseMaterials');
const basePropData = {
itemMetadata: this.courseMaterials.getModules().first().getLessons().first().getItemMetadatas().first();,
itemGrade: courseViewGradeData
};
before(() => {
beforeEachLoadPromisedObject('courseMaterials', 'pages/open-course/common/singletons/courseMaterials');
itemMetadata = this.courseMaterials.getModules().first().getLessons().first().getItemMetadatas().first();
console.log(this.itemMetadata);
console.log('safljahsdlfkjhasldkfjha=====================================');
ItemComponent = environment.require('bundles/ondemand/components/moduleLessons/ItemComponent');
wrapper = shallow(<ItemComponent {...basePropData} />);
});
describe('should display lockedness', () => {
it('with an icon and a tooltip', () => {
console.log('safljahsdlfkjhasldkfjha=====================================');
console.log(itemMetadata);
const LockedTooltip = this.environment.require('bundles/ondemand/components/sessions/LockedTooltip');
const Icon = this.environment.require('bundles/iconfont/Icon');
expect(wrapper.find('Icon')).to.have.length(1);
expect(wrapper.find('LockedTooltip')).to.have.length(1);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.