1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00
chess/test/features/games_test.exs
Dan Barber d888ab8d83
Make sure the JS works in PhantomJS
PhantomJS does not implement `Object.assign` which is how we were
updating the state immutably. I've switched it over to use the
ImmutableJS library instead.
2016-12-22 10:28:33 +00:00

30 lines
534 B
Elixir

defmodule Chess.GamesTest do
use Chess.FeatureCase
test "visit homepage" do
navigate_to "/"
find_element(:css, "body")
assert title_text == "Chess"
end
test "can create a new game" do
navigate_to "/"
create_game
assert page_has_chess_board
end
defp create_game do
click({:css, "form.create-game button[type='submit']"})
end
defp title_text do
find_element(:css, "header h1") |> visible_text
end
defp page_has_chess_board do
element_displayed?({:css, ".board"})
end
end