-
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.
Made unit tests independent of any HTML page. Created TextAreaComponent with manual and automated tests. Also: Created CSS class layoutTable for vertically aligning elements within table cell. Removed ImageComponent: Not interactive and already used with logo. Removed IframeComponent: Not interactive.
- Loading branch information
1 parent
6ef86c2
commit 2954ea7
Showing
15 changed files
with
136 additions
and
198 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
CLASS TestTextAreaComponent EXTENDS Test MODULE TestBrowserApp CLASSVARS '' VARS '' | ||
|
||
test | ||
| textAreaComponent textArea | | ||
textAreaComponent := MyBrowserApp default findComponent: TextAreaComponent. | ||
textArea := textAreaComponent textArea. | ||
|
||
self assert: [ textArea placeholder = 'Enter text here...' ]. | ||
self assert: [ textArea rows = 2 ]. | ||
self assert: [ textArea cols = 20 ]. | ||
self assert: [ textArea minLength = 1 ]. | ||
self assert: [ textArea maxLength = 100 ]. | ||
self assert: [ textArea wrap = 'soft' ]. | ||
self assert: [ textArea value = 'aa\nbb' ]. | ||
! | ||
testGui | ||
| textAreaComponent | | ||
textAreaComponent := MyBrowserApp default findComponent: TextAreaComponent. | ||
|
||
textAreaComponent textArea value: 'cc\ndd'. | ||
textAreaComponent outputButton click. | ||
Timer timeout: 500 then: [ | ||
self assert: [ textAreaComponent outputSpan textContent = 'cc\ndd' ] ]. | ||
! |
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,34 @@ | ||
CLASS TextAreaComponent EXTENDS Component MODULE BrowserApp CLASSVARS '' | ||
VARS 'textArea outputButton outputSpan' | ||
|
||
htmlPath | ||
^ 'Components/TextAreaComponent.html'. | ||
! | ||
start | ||
self bindElements. | ||
! | ||
bindElements | ||
textArea := Document getElementById: 'textArea' class: HtmlTextAreaElement. | ||
outputButton := Document getElementById: 'textAreaOutputButton' class: HtmlButtonElement. | ||
outputSpan := Document getElementById: 'textAreaOutputSpan' class: HtmlSpanElement. | ||
|
||
outputButton onClick: [ self onOutputButtonClicked ]. | ||
! | ||
onOutputButtonClicked | ||
| textAreaString | | ||
|
||
outputSpan textContent: textArea value. | ||
! | ||
|
||
"Accessing" | ||
|
||
textArea | ||
^ textArea. | ||
! | ||
outputButton | ||
^ outputButton. | ||
! | ||
outputSpan | ||
^ outputSpan. | ||
! | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
<tr> | ||
<th scope="row"> | ||
<p class="field">TextArea</p> | ||
</th> | ||
<td> | ||
<table class="layoutTable"> | ||
<tr> | ||
<td> | ||
<textarea id="textArea" placeholder="Enter text here..." rows="2" cols="20" minlength="1" maxLength="100" | ||
wrap="soft" autocapitalize="none">aa bb</textarea> | ||
<td> | ||
<button id="textAreaOutputButton">Output</button> | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
<td> | ||
<span id="textAreaOutputSpan">[Output]</span> | ||
</td> | ||
</tr> |
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
Oops, something went wrong.