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
Making cards with ability require a target-selection #115
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
3520521
first, many errors
Masclins 7be1aa9
removed log
Masclins 8586fd3
can drop
Masclins dea6f39
removed '!== undefined'
Masclins 42ceb58
clearer
Masclins b92df0e
couldn't remove this!
Masclins 6da91ee
some changes
Masclins 43ba7da
solved bug
Masclins 56769c2
solved coloring problem
Masclins eb24013
passing clickedCard
Masclins 37d42b9
change for allowing drop
Masclins 47f6cc9
one test
Masclins 5c848f9
Merge branch 'master' into select-target
kenan-rhoton a693d86
Merge branch 'master' of https://github.com/kenan-rhoton/card-game in…
Masclins f9bf69f
some test
Masclins 9c9c565
Merge branch 'select-target' of https://github.com/masclins/card-game…
Masclins ebe3530
wrong name
Masclins 64281f1
cute space
Masclins ce01ff3
status message
Masclins 0c8653d
mocking status for test
Masclins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ability
add-power
is set as an attribute, so we can easily check it for a card.Maybe this two lines can be simplified.