|
@@ -181,6 +181,55 @@ messageSends: ["insertDomite:", "new", "insertString:", "open", "yourself", "ass
|
|
}),
|
|
}),
|
|
$globals.DOMiteTest);
|
|
$globals.DOMiteTest);
|
|
|
|
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "testFromBadSelectorIsInvalid",
|
|
|
|
+protocol: 'testing',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+var d;
|
|
|
|
+function $Domite(){return $globals.Domite||(typeof Domite=="undefined"?nil:Domite)}
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+var $1,$2;
|
|
|
|
+d=$recv($Domite())._fromSelector_("#goo");
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+$ctx1.sendIdx["fromSelector:"]=1;
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+$1=$recv(d)._isInvalid();
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+$ctx1.sendIdx["isInvalid"]=1;
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+self._assert_($1);
|
|
|
|
+d=$recv($Domite())._fromSelector_("body");
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+$ctx1.sendIdx["fromSelector:"]=2;
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+$2=$recv(d)._isInvalid();
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+$ctx1.sendIdx["isInvalid"]=2;
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+self._deny_($2);
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+$ctx1.sendIdx["deny:"]=1;
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+d=$recv($Domite())._fromSelector_("html body div#fixture");
|
|
|
|
+self._deny_($recv(d)._isInvalid());
|
|
|
|
+return self;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"testFromBadSelectorIsInvalid",{d:d},$globals.DOMiteTest)});
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+},
|
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
|
+args: [],
|
|
|
|
+source: "testFromBadSelectorIsInvalid\x0a\x09| d |\x0a\x09d := Domite fromSelector: '#goo'.\x0a\x09self assert: d isInvalid.\x0a\x09d := Domite fromSelector: 'body'.\x0a\x09self deny: d isInvalid.\x0a\x09d := Domite fromSelector: 'html body div#fixture'.\x0a\x09self deny: d isInvalid",
|
|
|
|
+referencedClasses: ["Domite"],
|
|
|
|
+//>>excludeEnd("ide");
|
|
|
|
+messageSends: ["fromSelector:", "assert:", "isInvalid", "deny:"]
|
|
|
|
+}),
|
|
|
|
+$globals.DOMiteTest);
|
|
|
|
+
|
|
$core.addMethod(
|
|
$core.addMethod(
|
|
$core.method({
|
|
$core.method({
|
|
selector: "testInsertElement",
|
|
selector: "testInsertElement",
|
|
@@ -192,7 +241,7 @@ function $Domite(){return $globals.Domite||(typeof Domite=="undefined"?nil:Domit
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
return $core.withContext(function($ctx1) {
|
|
return $core.withContext(function($ctx1) {
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
-d=$recv($Domite())._fromElement_(self["@fixtureDiv"]);
|
|
|
|
|
|
+d=$recv($Domite())._fromSelector_("html body div#fixture");
|
|
$recv(d)._insertDomite_($recv($Domite())._newElement_("p"));
|
|
$recv(d)._insertDomite_($recv($Domite())._newElement_("p"));
|
|
self._assert_($recv($recv($recv(document)._body())._innerHTML())._endsWith_(">sentinel<p></p></div>"));
|
|
self._assert_($recv($recv($recv(document)._body())._innerHTML())._endsWith_(">sentinel<p></p></div>"));
|
|
return self;
|
|
return self;
|
|
@@ -202,10 +251,10 @@ return self;
|
|
},
|
|
},
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
args: [],
|
|
args: [],
|
|
-source: "testInsertElement\x0a\x09| d |\x0a\x09d := Domite fromElement: fixtureDiv.\x0a\x09d insertDomite: (Domite newElement: 'p').\x0a\x09self assert: (document body innerHTML endsWith: '>sentinel<p></p></div>')",
|
|
|
|
|
|
+source: "testInsertElement\x0a\x09| d |\x0a\x09d := Domite fromSelector: 'html body div#fixture'.\x0a\x09d insertDomite: (Domite newElement: 'p').\x0a\x09self assert: (document body innerHTML endsWith: '>sentinel<p></p></div>')",
|
|
referencedClasses: ["Domite"],
|
|
referencedClasses: ["Domite"],
|
|
//>>excludeEnd("ide");
|
|
//>>excludeEnd("ide");
|
|
-messageSends: ["fromElement:", "insertDomite:", "newElement:", "assert:", "endsWith:", "innerHTML", "body"]
|
|
|
|
|
|
+messageSends: ["fromSelector:", "insertDomite:", "newElement:", "assert:", "endsWith:", "innerHTML", "body"]
|
|
}),
|
|
}),
|
|
$globals.DOMiteTest);
|
|
$globals.DOMiteTest);
|
|
|
|
|
|
@@ -259,7 +308,7 @@ function $Domite(){return $globals.Domite||(typeof Domite=="undefined"?nil:Domit
|
|
return $core.withContext(function($ctx1) {
|
|
return $core.withContext(function($ctx1) {
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
var $1,$3,$4,$2,$5,$7,$8,$6,$9,$10;
|
|
var $1,$3,$4,$2,$5,$7,$8,$6,$9,$10;
|
|
-d=$recv($Domite())._fromElement_(self["@fixtureDiv"]);
|
|
|
|
|
|
+d=$recv($Domite())._fromSelector_("#fixture");
|
|
p=$recv($Domite())._newElement_("p");
|
|
p=$recv($Domite())._newElement_("p");
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
$ctx1.sendIdx["newElement:"]=1;
|
|
$ctx1.sendIdx["newElement:"]=1;
|
|
@@ -313,10 +362,10 @@ return self;
|
|
},
|
|
},
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
args: [],
|
|
args: [],
|
|
-source: "testInsertElementTwoLevelViaFragments\x0a\x09| d p s |\x0a\x09d := Domite fromElement: fixtureDiv.\x0a\x09p := Domite newElement: 'p'.\x0a\x09d insertDomite: (Domite open insertDomite: p; yourself).\x0a\x09s := Domite newElement: 'span'.\x0a\x09p insertDomite: (Domite open insertDomite: s; yourself).\x0a\x09s insertDomite: (Domite open insertString: 'dom-mite'; yourself).\x0a\x09self assert: (document body innerHTML endsWith: '>sentinel<p><span>dom-mite</span></p></div>')",
|
|
|
|
|
|
+source: "testInsertElementTwoLevelViaFragments\x0a\x09| d p s |\x0a\x09d := Domite fromSelector: '#fixture'.\x0a\x09p := Domite newElement: 'p'.\x0a\x09d insertDomite: (Domite open insertDomite: p; yourself).\x0a\x09s := Domite newElement: 'span'.\x0a\x09p insertDomite: (Domite open insertDomite: s; yourself).\x0a\x09s insertDomite: (Domite open insertString: 'dom-mite'; yourself).\x0a\x09self assert: (document body innerHTML endsWith: '>sentinel<p><span>dom-mite</span></p></div>')",
|
|
referencedClasses: ["Domite"],
|
|
referencedClasses: ["Domite"],
|
|
//>>excludeEnd("ide");
|
|
//>>excludeEnd("ide");
|
|
-messageSends: ["fromElement:", "newElement:", "insertDomite:", "open", "yourself", "insertString:", "assert:", "endsWith:", "innerHTML", "body"]
|
|
|
|
|
|
+messageSends: ["fromSelector:", "newElement:", "insertDomite:", "open", "yourself", "insertString:", "assert:", "endsWith:", "innerHTML", "body"]
|
|
}),
|
|
}),
|
|
$globals.DOMiteTest);
|
|
$globals.DOMiteTest);
|
|
|
|
|
|
@@ -477,7 +526,7 @@ function $Domite(){return $globals.Domite||(typeof Domite=="undefined"?nil:Domit
|
|
return $core.withContext(function($ctx1) {
|
|
return $core.withContext(function($ctx1) {
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
var $1,$2;
|
|
var $1,$2;
|
|
-d=$recv($Domite())._fromElement_(self["@fixtureDiv"]);
|
|
|
|
|
|
+d=$recv($Domite())._fromSelector_("#fixture");
|
|
$1=$recv($Domite())._open();
|
|
$1=$recv($Domite())._open();
|
|
$recv($1)._insertString_("a foo in a bar");
|
|
$recv($1)._insertString_("a foo in a bar");
|
|
$2=$recv($1)._yourself();
|
|
$2=$recv($1)._yourself();
|
|
@@ -490,10 +539,10 @@ return self;
|
|
},
|
|
},
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
args: [],
|
|
args: [],
|
|
-source: "testInsertStringInFragment\x0a\x09| d |\x0a\x09d := Domite fromElement: fixtureDiv.\x0a\x09d insertDomite: (Domite open insertString: 'a foo in a bar'; yourself).\x0a\x09self assert: (document body innerHTML endsWith: '>sentinela foo in a bar</div>')",
|
|
|
|
|
|
+source: "testInsertStringInFragment\x0a\x09| d |\x0a\x09d := Domite fromSelector: '#fixture'.\x0a\x09d insertDomite: (Domite open insertString: 'a foo in a bar'; yourself).\x0a\x09self assert: (document body innerHTML endsWith: '>sentinela foo in a bar</div>')",
|
|
referencedClasses: ["Domite"],
|
|
referencedClasses: ["Domite"],
|
|
//>>excludeEnd("ide");
|
|
//>>excludeEnd("ide");
|
|
-messageSends: ["fromElement:", "insertDomite:", "insertString:", "open", "yourself", "assert:", "endsWith:", "innerHTML", "body"]
|
|
|
|
|
|
+messageSends: ["fromSelector:", "insertDomite:", "insertString:", "open", "yourself", "assert:", "endsWith:", "innerHTML", "body"]
|
|
}),
|
|
}),
|
|
$globals.DOMiteTest);
|
|
$globals.DOMiteTest);
|
|
|
|
|
|
@@ -546,7 +595,7 @@ function $Domite(){return $globals.Domite||(typeof Domite=="undefined"?nil:Domit
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
return $core.withContext(function($ctx1) {
|
|
return $core.withContext(function($ctx1) {
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
-d=$recv($Domite())._fromElement_(self["@fixtureDiv"]);
|
|
|
|
|
|
+d=$recv($Domite())._fromSelector_("#fixture");
|
|
p=$recv($Domite())._newElement_("p");
|
|
p=$recv($Domite())._newElement_("p");
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
$ctx1.sendIdx["newElement:"]=1;
|
|
$ctx1.sendIdx["newElement:"]=1;
|
|
@@ -575,10 +624,10 @@ return self;
|
|
},
|
|
},
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
args: [],
|
|
args: [],
|
|
-source: "testMultipleInsertsWithClear\x0a\x09| d p s |\x0a\x09d := Domite fromElement: fixtureDiv.\x0a\x09p := Domite newElement: 'p'.\x0a\x09d insertDomite: p.\x0a\x09s := Domite newElement: 'span'.\x0a\x09d insertDomite: s.\x0a\x09d clearHere.\x0a\x09d insertString: 'dom-mite'.\x0a\x09d clearHere.\x0a\x09d clearHere.\x0a\x09self assert: (document body innerHTML endsWith: '></div>')",
|
|
|
|
|
|
+source: "testMultipleInsertsWithClear\x0a\x09| d p s |\x0a\x09d := Domite fromSelector: '#fixture'.\x0a\x09p := Domite newElement: 'p'.\x0a\x09d insertDomite: p.\x0a\x09s := Domite newElement: 'span'.\x0a\x09d insertDomite: s.\x0a\x09d clearHere.\x0a\x09d insertString: 'dom-mite'.\x0a\x09d clearHere.\x0a\x09d clearHere.\x0a\x09self assert: (document body innerHTML endsWith: '></div>')",
|
|
referencedClasses: ["Domite"],
|
|
referencedClasses: ["Domite"],
|
|
//>>excludeEnd("ide");
|
|
//>>excludeEnd("ide");
|
|
-messageSends: ["fromElement:", "newElement:", "insertDomite:", "clearHere", "insertString:", "assert:", "endsWith:", "innerHTML", "body"]
|
|
|
|
|
|
+messageSends: ["fromSelector:", "newElement:", "insertDomite:", "clearHere", "insertString:", "assert:", "endsWith:", "innerHTML", "body"]
|
|
}),
|
|
}),
|
|
$globals.DOMiteTest);
|
|
$globals.DOMiteTest);
|
|
|
|
|