mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 01:10:04 +02:00
YES converted over local storage
This commit is contained in:
parent
ca938ec79e
commit
3a710c8ab4
3 changed files with 59 additions and 48 deletions
|
@ -17,6 +17,36 @@ describe('this store', function() {
|
|||
|
||||
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');
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue