|
@@ -23,6 +23,7 @@ args: [],
|
|
|
source: "testedClass\x0a\x09^ Silk",
|
|
|
referencedClasses: ["Silk"],
|
|
|
//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
messageSends: []
|
|
|
}),
|
|
|
$globals.SilkInheritedTest);
|
|
@@ -67,6 +68,7 @@ args: ["aString"],
|
|
|
source: "assertBodyEndsWith: aString\x0a\x09| sanitizedBody sanitizedAssertion |\x0a\x09sanitizedBody := document body innerHTML replace: '\x5cs*' with: ''.\x0a\x09sanitizedAssertion := aString replace: '\x5cs*' with: ''.\x0a\x09self assert: sanitizedBody size >= sanitizedAssertion size.\x0a\x09self\x0a\x09\x09assert: (sanitizedBody last: sanitizedAssertion size)\x0a\x09\x09equals: sanitizedAssertion",
|
|
|
referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
messageSends: ["replace:with:", "innerHTML", "body", "assert:", ">=", "size", "assert:equals:", "last:"]
|
|
|
}),
|
|
|
$globals.SilkTest);
|
|
@@ -140,6 +142,7 @@ args: ["aStringArray"],
|
|
|
source: "assertBodyEndsWithOneOf: aStringArray\x0a\x09| sanitizedBody err |\x0a\x09sanitizedBody := document body innerHTML replace: '\x5cs*' with: ''.\x0a\x09aStringArray do: [ :aString |\x0a\x09\x09| sanitizedAssertion |\x0a\x09\x09sanitizedAssertion := aString replace: '\x5cs*' with: ''.\x0a\x09\x09[ self\x0a\x09\x09\x09assert: sanitizedBody size >= sanitizedAssertion size;\x0a\x09\x09\x09assert: (sanitizedBody last: sanitizedAssertion size)\x0a\x09\x09\x09equals: sanitizedAssertion. ^ self ] on: Error do: [ :e | err := e ]].\x0a\x09err ifNotNil: [ err signal ]",
|
|
|
referencedClasses: ["Error"],
|
|
|
//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
messageSends: ["replace:with:", "innerHTML", "body", "do:", "on:do:", "assert:", ">=", "size", "assert:equals:", "last:", "ifNotNil:", "signal"]
|
|
|
}),
|
|
|
$globals.SilkTest);
|
|
@@ -167,6 +170,7 @@ args: [],
|
|
|
source: "setUp\x0a\x09fixtureDiv := document createElement: 'div'.\x0a\x09document body appendChild: fixtureDiv.\x0a\x09fixtureDiv setAttribute: 'id' to: 'fixture'.\x0a\x09fixtureDiv innerHTML: 'sentinel'",
|
|
|
referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
messageSends: ["createElement:", "appendChild:", "body", "setAttribute:to:", "innerHTML:"]
|
|
|
}),
|
|
|
$globals.SilkTest);
|
|
@@ -199,6 +203,7 @@ args: [],
|
|
|
source: "tearDown\x0a\x09| lastChild |\x0a\x09lastChild := document body lastChild.\x0a\x09self assert: lastChild equals: fixtureDiv.\x0a\x09document body removeChild: lastChild",
|
|
|
referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
messageSends: ["lastChild", "body", "assert:equals:", "removeChild:"]
|
|
|
}),
|
|
|
$globals.SilkTest);
|
|
@@ -253,6 +258,7 @@ args: [],
|
|
|
source: "testInsertTable\x0a\x0a\x09| d tbl |\x0a\x0a\x09d := 'html body div#fixture' asSilk.\x0a\x0a\x09tbl := d TABLE.\x0a\x0a\x09tbl TR\x0a\x09\x09TD: 'A';\x0a\x09\x09TD: 'B';\x0a\x09\x09TD: 'C'.\x0a\x09\x0a\x09tbl TR\x0a\x09\x09TD: 'D';\x0a\x09\x09TD: 'E';\x0a\x09\x09TD: 'F'.\x0a\x09\x0a\x09self assertBodyEndsWith: '>sentinel<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>D</td><td>E</td><td>F</td></tr></table></div>'",
|
|
|
referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
messageSends: ["asSilk", "TABLE", "TD:", "TR", "assertBodyEndsWith:"]
|
|
|
}),
|
|
|
$globals.SilkTest);
|
|
@@ -309,6 +315,7 @@ args: [],
|
|
|
source: "testInsertTable2\x0a\x0a\x09| d tbl |\x0a\x0a\x09d := 'html body div#fixture' asSilk.\x0a\x0a\x09tbl := d TABLE.\x0a\x0a\x09tbl TR: {\x0a\x09\x09Silk TD: 'A'.\x0a\x09\x09Silk TD: 'B'.\x0a\x09\x09Silk TD: 'C'};\x0a\x09\x09TR: {\x0a\x09\x09Silk TD: 'D'.\x0a\x09\x09Silk TD: 'E'.\x0a\x09\x09Silk TD: 'F'}.\x0a\x09\x0a\x09self assertBodyEndsWith: '>sentinel<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>D</td><td>E</td><td>F</td></tr></table></div>'",
|
|
|
referencedClasses: ["Silk"],
|
|
|
//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
messageSends: ["asSilk", "TABLE", "TR:", "TD:", "assertBodyEndsWith:"]
|
|
|
}),
|
|
|
$globals.SilkTest);
|
|
@@ -391,6 +398,7 @@ args: [],
|
|
|
source: "testNestedDIVsWithAttributes\x0a \x22demonstrates how DIVs are nested and given attributes\x22\x0a\x09| s |\x0a\x0a\x09s := '#fixture' asSilk.\x0a\x09\x0a\x09s := s DIV << ('id' -> 'container') << ('class' -> 'mySilkContainerClass').\x0a\x09s DIV << ('id' -> 'contentarea') << 'here comes the content'.\x0a\x09s := s DIV << ('id' -> 'toolbar') << ('class' -> 'myToolbarClass').\x0a\x09(s BUTTON: 'do something') on: 'click' bind: [Transcript show: 'button pressed'].\x0a\x09\x0a\x09self assertBodyEndsWithOneOf: #(\x0a\x09\x09'>sentinel<div class=\x22mySilkContainerClass\x22 id=\x22container\x22><div id=\x22contentarea\x22>here comes the content</div><div class=\x22myToolbarClass\x22 id=\x22toolbar\x22><button>do something</button></div></div></div>'\x0a\x09\x09'>sentinel<div id=\x22container\x22 class=\x22mySilkContainerClass\x22><div id=\x22contentarea\x22>here comes the content</div><div id=\x22toolbar\x22 class=\x22myToolbarClass\x22><button>do something</button></div></div></div>'\x0a\x09)",
|
|
|
referencedClasses: ["Transcript"],
|
|
|
//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
messageSends: ["asSilk", "<<", "DIV", "->", "on:bind:", "BUTTON:", "show:", "assertBodyEndsWithOneOf:"]
|
|
|
}),
|
|
|
$globals.SilkTest);
|
|
@@ -436,6 +444,7 @@ args: [],
|
|
|
source: "testOnClickEvent\x0a\x09\x22#on:bind\x22\x0a\x09\x0a\x09| s para |\x0a\x0a\x09s := '#fixture' asSilk.\x0a\x09para := s P: 'DOM'. \x0a\x0a\x09self timeout: 100.\x0a\x0a\x09(self async: [para on: 'click' bind:\x0a\x09\x09\x09[\x22Test successful\x22 self finished].\x0a\x0a\x09\x09'#fixture p' asJQuery trigger: 'click'.\x0a\x09\x09]) fork",
|
|
|
referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
+pragmas: [],
|
|
|
messageSends: ["asSilk", "P:", "timeout:", "fork", "async:", "on:bind:", "finished", "trigger:", "asJQuery"]
|
|
|
}),
|
|
|
$globals.SilkTest);
|