これは私のテストコードです:
describe("Login", function(){
beforeEach(function(){
loadFixtures('login-fixture.html');
})
it("should enable the button when checking 'remember password'", function(){
$('#remember').trigger('click');
expect($('#keepIn')).not.toBeDisabled();
});
});
そしてこれは私のプロダクションコードです:
$(document).ready(function(){
$('#remember').click(function(e) {
if($('#remember').is(':checked'))
{
$('#keepIn').removeAttr('disabled');
}
});
});
これは機能していません。本番コードが呼び出されることはありません。トリガーイベントの前後とトリガーの後にチェックボックスがオンになっているアラートを配置しましたが、.click関数が呼び出されません。
なぜこれが起こっているのかについて何か考えはありますか?