I am working on a Angular.js application with Bootstrap (and jQuery). I am using Karma Jasmine with PhantomJS for testing.
I have written a test that runs a method from my controller and compares two identical objects.
it('should have a showDialog method which prompts a crud dialog', function () {
ctrl.showDialog({
id: 123,
});
expect(ctrl.crudDialogData).toBe({
id: 123,
});
});
The showDialog()
method stores the argument passed in to the crudDialogData
property.
When running my tests I receive the following error:
Expected Object({ id: 123 }) to be Object({ id: 123 }).
As far as I can see, this should be a pass. Any help?