This repository has been archived by the owner on Oct 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making cards with ability require a target-selection (#115)
* first, many errors * removed log * can drop * removed '!== undefined' * clearer * couldn't remove this! * some changes * solved bug * solved coloring problem * passing clickedCard * change for allowing drop * one test * some test * wrong name * cute space * status message * mocking status for test
- Loading branch information
1 parent
91a08ce
commit e4582ed
Showing
7 changed files
with
72 additions
and
28 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict"; | ||
|
||
const play = require('game/play/play.js'); | ||
|
||
test('Playing cards changes background as intended', () => { | ||
var card = document.createElement("div"); | ||
var mockedStatus = document.createElement("div"); | ||
mockedStatus.setAttribute("id", "game-status"); | ||
document.body.appendChild(mockedStatus); | ||
|
||
card.setAttribute("add-power", "undefined"); | ||
play.playCard(card); | ||
expect(card.style.background).toBe("green"); | ||
|
||
card.setAttribute("add-power", 1); | ||
play.playCard(card); | ||
expect(card.style.background).toBe("yellow"); | ||
|
||
card.setAttribute("target", 1); | ||
play.playCard(card); | ||
expect(card.style.background).toBe("green"); | ||
}); |