Example #1
0
		it("should display an error message when the security delete is unsuccessful", (): void => {
			securityDeleteController.security.id = -1;
			securityDeleteController.deleteSecurity();
			(securityDeleteController.errorMessage as string).should.equal("unsuccessful");
		});
Example #2
0
		it("should delete the security", (): void => {
			securityDeleteController.deleteSecurity();
			securityModel.destroy.should.have.been.calledWith(security);
		});
Example #3
0
		it("should close the modal when the security delete is successful", (): void => {
			securityDeleteController.deleteSecurity();
			$uibModalInstance.close.should.have.been.called;
		});
Example #4
0
		it("should reset any previous error messages", (): void => {
			securityDeleteController.errorMessage = "error message";
			securityDeleteController.deleteSecurity();
			(null === securityDeleteController.errorMessage).should.be.true;
		});