fix a casper test

This commit is contained in:
Peter Cottle 2015-04-12 20:03:03 -07:00
parent 9aa77aec8c
commit ab064a2502
2 changed files with 4 additions and 3 deletions

View file

@ -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)

View file

@ -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