Move tests to the root

This commit is contained in:
Roman 2016-02-15 01:10:25 +05:00
parent 5d46a6ecd2
commit e068203893
16 changed files with 25 additions and 37 deletions

View file

@ -1,52 +0,0 @@
var CommandLineActions = require('../actions/CommandLineActions');
var CommandLineStore = require('../stores/CommandLineStore');
describe('this store', function() {
it('starts with no entries', function() {
expect(CommandLineStore.getCommandHistoryLength())
.toEqual(0);
});
it('receives new commands', function() {
var command = 'git commit; git checkout HEAD';
CommandLineActions.submitCommand(command);
expect(CommandLineStore.getCommandHistoryLength())
.toEqual(1);
expect(CommandLineStore.getCommandHistory()[0])
.toEqual(command);
var newCommand = 'echo "yo dude";';
CommandLineActions.submitCommand(newCommand);
expect(CommandLineStore.getCommandHistoryLength())
.toEqual(2);
expect(CommandLineStore.getCommandHistory()[0])
.toEqual(newCommand);
expect(CommandLineStore.getCommandHistory()[1])
.toEqual(command);
});
it('slices after max length', function() {
var maxLength = CommandLineStore.getMaxHistoryLength();
var numOver = 10;
for (var i = 0; i < maxLength + numOver; i++) {
CommandLineActions.submitCommand('commandNum' + i);
}
var numNow = 11 + numOver;
expect(
CommandLineStore.getCommandHistoryLength()
).toEqual(numNow);
expect(
CommandLineStore.getCommandHistory()[0]
).toEqual('commandNum109');
expect(
CommandLineStore.getCommandHistory()[numNow - 1]
).toEqual('commandNum89');
});
});