   statusGameSelector: (your_turn, first_or_last) ->
     div_id = if your_turn then 'your_turn_games' else 'not_your_turn_games'
     @gameSelector div_id, first_or_last
-    
+
   lastGameSelector: (your_turn) ->
     @statusGameSelector your_turn, 'last'
 

  names: ['ChallengeTest', 'challenge']
  description: "Tests the 'Challenge a player process"
  numTests: 17
  testBody: (test) =>
  # Be sure not to use the 'createGame' shortcut.
    SHINDOU_EMAIL = 'shindou@ki-in.jp'

class BasicChatTest extends BrowserTest
  names: ['BasicChatTest', 'chat']
  description: "Very basic chat functionality test"
  numTests: 27

  testBody: (test) =>
    addComment = (comment) ->
      form_values = 'input[name="comment"]' : comment
      # The final 'true' argument means that the form is submitted.
      casper.fillSelectors 'form#chat-form', form_values, true

    checkComment = (color, comment, testMessage) ->
      casper.waitForText comment, ->
        comments_selector = ".game-chat .chat-comments .chat-comment-#{color}"
        test.assertSelectorHasText comments_selector, comment, testMessage

    ONE_EMAIL = 'player@one.com'
    TWO_EMAIL = 'playa@dos.es'

    ONE_CHAT = ['Are you dancing?', "I'm asking"]
    TWO_CHAT =  ['Are you asking?', "I'm dancing"]

    clearGamesForPlayer ONE_EMAIL
    clearGamesForPlayer TWO_EMAIL
