forked from rooseveltframework/teddy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes rooseveltframework#412 closes many unreported bugs wrote a test for rooseveltframework#404 wrote a test for rooseveltframework#357 but upon further investigate now consider it a wontfix
- Loading branch information
Showing
129 changed files
with
414 additions
and
90 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
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 |
---|---|---|
|
@@ -65,4 +65,3 @@ | |
<else> | ||
<p>and: false</p> | ||
</else> | ||
|
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 |
---|---|---|
|
@@ -33,4 +33,3 @@ | |
<else> | ||
<p>and: false</p> | ||
</else> | ||
|
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{! | ||
should evaluate if statement that contains an element with a regex pattern | ||
!} | ||
|
||
<if something> | ||
<input type='text' name='date' placeholder='DD/MM/YYYY' id='date' pattern='^(3[0-1]|[1-2]\d|[1-9]|0\d)\/(1[0-2]|[1-9]|0\d)\/[1-2]\d{3}$'> | ||
</if> |
10 changes: 10 additions & 0 deletions
10
test/templates/conditionals/ifJSONStringPrintJSONString.html
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,10 @@ | ||
{! | ||
should correctly print the JSON string as unmodified text | ||
!} | ||
|
||
<if complexJSONString> | ||
<pre>{complexJSONString|p|s}</pre> | ||
</if> | ||
<else> | ||
<p>Should not render.</p> | ||
</else> |
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,14 @@ | ||
{! | ||
should print the letters behind both <if> statements nested in the <loop> | ||
!} | ||
|
||
<if something> | ||
<loop through='objectOfObjects' val='obj'> | ||
<if obj.a> | ||
<p>a</p> | ||
</if> | ||
<if obj.a> | ||
<p>b</p> | ||
</if> | ||
</loop> | ||
</if> |
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,6 +1,7 @@ | ||
{! | ||
should render nothing if condition isn't met | ||
!} | ||
|
||
<div> | ||
<if Test> | ||
<p>Shouldn't See Me!</p> | ||
|
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
15 changes: 15 additions & 0 deletions
15
test/templates/conditionals/ifWithSiblingIfWithNestedIfElse.html
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,15 @@ | ||
{! | ||
should evaluate the <unless> condition as true and not render the other conditions | ||
!} | ||
|
||
<if something='It will not be this'> | ||
<p>Should not render.</p> | ||
</if> | ||
<if something> | ||
<unless something='Cannot be this'> | ||
<p>Should render.</p> | ||
</unless> | ||
<else> | ||
<p>Should not render.</p> | ||
</else> | ||
</if> |
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,20 @@ | ||
{! | ||
should render the nested <else> condition | ||
!} | ||
|
||
<if something> | ||
<if not:somethingElse> | ||
<p>The variable 'somethingElse' is not present but 'something' is</p> | ||
</if> | ||
<else> | ||
<p>The variable 'something' and 'somethingElse' are both present</p> | ||
</else> | ||
</if> | ||
<elseif somethingElse> | ||
<p>The variable 'somethingElse' is present but 'something' is not</p> | ||
</elseif> | ||
<else> | ||
<if something> | ||
<p>The variable 'something' is not present and the variable 'somethingElse' is not present</p> | ||
</if> | ||
</else> |
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
<p> | ||
gif-jpg-png | ||
<if something> If that should not be parsed, How art thou?</if> | ||
</p> | ||
</p> |
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,4 +1,5 @@ | ||
{! | ||
should evaluate one line if "if-something" as true | ||
!} | ||
|
||
<p if-something true="class='something-is-present'" false="class='something-is-not-present'">One line if.</p> |
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,4 +1,5 @@ | ||
{! | ||
should evaluate one line if "if-something" with a dynamic value | ||
!} | ||
|
||
<p if-something='{dynamicValue}' true='class="some-class"'>{dynamicValue}</p> |
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,4 +1,5 @@ | ||
{! | ||
should evaluate one line if "if-something=''" as false | ||
!} | ||
|
||
<p if-something='' true="class='something-is-value'" false="class='something-is-not-empty'">One line if.</p> |
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,4 +1,5 @@ | ||
{! | ||
should evaluate one line if as false and apply no class | ||
!} | ||
|
||
<p if-noExist true="class='something-is-present'"></p> |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{! | ||
should evaluate both one line ifs "if-something" as true twice and apply two classes | ||
!} | ||
|
||
<p if-something true="class='something-is-present'" false="class='something-is-not-present'" if-something='' false="data-only-renders-when-something-is-not-empty" if-something true="data-should-render" false="data-should-not-render">One line if.</p> |
Oops, something went wrong.