Pregunta

Does anyone know how I can go about testing this in Jasmine?

function gameWon() {
  $('#final_message_cpu').html('You WON!!!')
  $('.computer_selection').css('display', 'block');
  $('#show_after_starting').remove();
  $('#hide_after_starting').css('display', 'inline')
  $('#hide_after_starting').click(function() {
    location.reload();
 })
}

Is there a way I can just test to see if $('#show_after_starting') has been removed?

¿Fue útil?

Solución

Yes:

expect($('#show_after_starting').length).toBe(0);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top