-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from skedwards88/announce-custom
Announce custom crossjigs
- Loading branch information
Showing
7 changed files
with
77 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
import {getInitialState} from "./getInitialState"; | ||
|
||
describe("getInitialState", () => { | ||
test("returns 'rules' if hasVisited is false", () => { | ||
expect(getInitialState("game", false)).toBe("rules"); | ||
test("returns 'rules' if hasVisitedEver is false", () => { | ||
expect(getInitialState("game", false, true)).toBe("rules"); | ||
|
||
expect(getInitialState("game", false, false)).toBe("rules"); | ||
}); | ||
|
||
test("returns 'whatsNew' if hasVisitedRecently is false", () => { | ||
expect(getInitialState("game", true, false)).toBe("whatsNew"); | ||
}); | ||
|
||
test("returns 'game' if hasVisited is true and savedDisplay is 'game", () => { | ||
expect(getInitialState("game", true)).toBe("game"); | ||
test("returns 'game' if hasVisitedEver and hasVisitedRecently are true and savedDisplay is 'game", () => { | ||
expect(getInitialState("game", true, true)).toBe("game"); | ||
}); | ||
|
||
test("returns 'daily' if hasVisited is true and savedDisplay is 'daily", () => { | ||
expect(getInitialState("daily", true)).toBe("daily"); | ||
test("returns 'daily' if hasVisitedEver and hasVisitedRecently are true and savedDisplay is 'daily", () => { | ||
expect(getInitialState("daily", true, true)).toBe("daily"); | ||
}); | ||
|
||
test("returns 'game' if hasVisited is true and savedDisplay is not 'game' or 'daily", () => { | ||
expect(getInitialState("rules", true)).toBe("game"); | ||
test("returns 'game' if hasVisitedEver and hasVisitedRecently are and savedDisplay is not 'game' or 'daily", () => { | ||
expect(getInitialState("rules", true, true)).toBe("game"); | ||
}); | ||
}); |
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,29 @@ | ||
import React from "react"; | ||
|
||
export default function WhatsNew({setDisplay}) { | ||
return ( | ||
<div className="App info"> | ||
<div id="rulesText"> | ||
<p>You can now create and share custom crossjigs!</p> | ||
<p> | ||
Click{" "} | ||
<button | ||
id="customIcon" | ||
className="rulesIcon" | ||
onClick={() => { | ||
setDisplay("custom"); | ||
}} | ||
></button>{" "} | ||
to build your own crossjig to share with friends. | ||
</p> | ||
</div> | ||
<button | ||
onClick={() => { | ||
setDisplay("game"); | ||
}} | ||
> | ||
{"Back to game"} | ||
</button> | ||
</div> | ||
); | ||
} |
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