Created
March 4, 2020 08:38
-
-
Save rbinksy/7b96a785d517b46bc4861b5b121c7cb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Status } from './Status'; | |
import renderWithRedux from 'utils/renderWithRedux'; | |
test('When monster takes damage, show success message', () => { | |
const { getByText } = renderWithRedux(<Status />, { | |
monster: { damageTaken: 2 } | |
}); | |
expect(getByText('You hit for 2!')); | |
}); | |
test('When player takes damage, show fail message', () => { | |
const { getByText } = renderWithRedux(<Status />, { | |
player: { damageTaken: 4 } | |
}); | |
expect(getByText('Ouch! you took 4 hits!')); | |
}); | |
test('When no damage is taken and is at least the first round, show draw message', () => { | |
const { getByText } = renderWithRedux(<Status />, { | |
player: { damageTaken: 0 }, | |
monster: { damageTaken: 0 }, | |
game: { currentRound: 1 } | |
}); | |
expect(getByText('Draw! Fight again!')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment