Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Commit

Permalink
Fix style and logic issues, per @noisecapella's comments on PR #500.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiefolsom committed Aug 18, 2015
1 parent ab88e1f commit 56b438c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ui/jstests/test-learning-resource.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ define(['QUnit', 'jquery', 'react', 'lodash', 'learning_resources',
assert.equal($vocabSelect.size(), 1);

// first vocab, two options
var $vocabOptions = $($vocabSelect).find("option");
var $vocabOptions = $vocabSelect.find("option");
assert.equal($vocabOptions.size(), 2);

assert.equal($vocabOptions[0].selected, true);
assert.equal($vocabOptions[1].selected, false);

// TestUtils.Simulate.change only simulates a change event,
// we need to update the value first ourselves
$($vocabSelect).val("prerequisite").trigger('change');
$vocabSelect.val("prerequisite").trigger('change');
React.addons.TestUtils.Simulate.change($vocabSelect);
component.forceUpdate(function() {
assert.equal($vocabOptions[0].selected, false);
Expand Down
3 changes: 2 additions & 1 deletion ui/static/ui/js/learning_resources.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ define('learning_resources', [

var VocabSelect = React.createClass({
render: function () {
var options = [];
var options;
options = _.map(this.props.vocabs, function(vocab) {
return {
id: vocab.vocabulary.slug,
Expand Down Expand Up @@ -97,6 +97,7 @@ define('learning_resources', [
_.forEach(this.props.vocabs, function(vocab) {
if (vocab.vocabulary.slug === selectedVocabulary.slug) {
currentVocabulary = vocab;
return false;
}
});

Expand Down

0 comments on commit 56b438c

Please sign in to comment.