diff --git a/src/__tests__/casperjs/command_view_test.js b/src/__tests__/casperjs/command_view_test.js index b6c25202..7fc65ab1 100644 --- a/src/__tests__/casperjs/command_view_test.js +++ b/src/__tests__/casperjs/command_view_test.js @@ -12,13 +12,13 @@ CasperUtils.start( .wait(200) .then(CasperUtils.screenshot.entirePage) .then(CasperUtils.asserts.selectorContainsText( - '#command_c32 div.commandLineResult p', + '#command_0 div.commandLineResult p', 'The command "asd" isn\'t supported, sorry!' )) .then(CasperUtils.enterCommand('git commit')) .wait(100) .then(CasperUtils.asserts.selectorContainsText( - '#command_c34 p.commandLine span:nth-child(2)', + '#command_1 p.commandLine span:nth-child(2)', 'git commit' )) .wait(700) diff --git a/src/js/views/commandViews.js b/src/js/views/commandViews.js index a9b14f46..d74a9c76 100644 --- a/src/js/views/commandViews.js +++ b/src/js/views/commandViews.js @@ -208,6 +208,7 @@ var CommandPromptView = Backbone.View.extend({ var CommandLineHistoryView = Backbone.View.extend({ initialize: function(options) { this.collection = options.collection; + this.commandNum = 0; this.collection.on('add', this.addOne, this); this.collection.on('reset', this.addAll, this); @@ -265,7 +266,7 @@ var CommandLineHistoryView = Backbone.View.extend({ addOne: function(command) { var div = document.createElement('div'); - div.id = 'command_' + command.cid; + div.id = 'command_' + this.commandNum++; React.render( React.createElement(CommandView, {command: command}), div