Files
edx-platform/lms/static/js/spec/edxnotes/models/tab_spec.js
polesye c7153be040 TNL-213: Let Students Add Personal Notes to Course Content.
Co-Authored-By: Jean-Michel Claus <jmc@edx.org>
Co-Authored-By: Brian Talbot <btalbot@edx.org>
Co-Authored-By: Tim Babych <tim@edx.org>
Co-Authored-By: Oleg Marshev <oleg@edx.org>
Co-Authored-By: Chris Rodriguez <crodriguez@edx.org>
2015-01-14 23:34:11 +02:00

34 lines
1.2 KiB
JavaScript

define([
'js/edxnotes/collections/tabs'
], function(TabsCollection) {
'use strict';
describe('EdxNotes TabModel', function() {
beforeEach(function () {
this.collection = new TabsCollection([{}, {}, {}]);
});
it('when activate current model, all other models are inactivated', function () {
this.collection.at(1).activate();
expect(this.collection.at(1).get('is_active')).toBeTruthy();
expect(this.collection.at(0).get('is_active')).toBeFalsy();
expect(this.collection.at(2).get('is_active')).toBeFalsy();
});
it('can inactivate current model', function () {
var model = this.collection.at(0);
model.activate();
expect(model.get('is_active')).toBeTruthy();
model.inactivate();
expect(model.get('is_active')).toBeFalsy();
});
it('can see correct activity status via isActive', function () {
var model = this.collection.at(0);
model.activate();
expect(model.isActive()).toBeTruthy();
model.inactivate();
expect(model.isActive()).toBeFalsy();
});
});
});