mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-26 13:05:35 +08:00
Adding e2e tests for the PersonalLog app
- added scenario runner - added scenario specs - cookie cleaning DSL - making rmLog independent on ordering in the view
This commit is contained in:
@@ -72,10 +72,10 @@ describe('example.personalLog.LogCtrl', function() {
|
||||
|
||||
|
||||
it('should delete a message identified by index', function() {
|
||||
logCtrl.rmLog(1);
|
||||
logCtrl.rmLog(logCtrl.logs[1]);
|
||||
expect(logCtrl.logs.length).toBe(3);
|
||||
|
||||
logCtrl.rmLog(2);
|
||||
logCtrl.rmLog(logCtrl.logs[2]);
|
||||
expect(logCtrl.logs.length).toBe(2);
|
||||
expect(logCtrl.logs[0].msg).toBe('message1');
|
||||
expect(logCtrl.logs[1].msg).toBe('message3');
|
||||
@@ -85,12 +85,12 @@ describe('example.personalLog.LogCtrl', function() {
|
||||
it('should update cookies when a log is deleted', function() {
|
||||
expect(logCtrl.$cookies.logs).toMatch(/\[\{.*?\}(,\{.*?\}){3}\]/);
|
||||
|
||||
logCtrl.rmLog(1);
|
||||
logCtrl.rmLog(logCtrl.logs[1]);
|
||||
expect(logCtrl.$cookies.logs).toMatch(/\[\{.*?\}(,\{.*?\}){2}\]/);
|
||||
|
||||
logCtrl.rmLog(0);
|
||||
logCtrl.rmLog(0);
|
||||
logCtrl.rmLog(0);
|
||||
logCtrl.rmLog(logCtrl.logs[0]);
|
||||
logCtrl.rmLog(logCtrl.logs[0]);
|
||||
logCtrl.rmLog(logCtrl.logs[0]);
|
||||
expect(logCtrl.$cookies.logs).toMatch(/\[\]/);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user