mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-28 20:29:15 +02:00
MINOR Removed fixtures for TreeDropdownField, inlining them instead: loading files doesn't work with JSTestDriver
This commit is contained in:
parent
fb502d7fc8
commit
aefc60e406
@ -3,9 +3,32 @@
|
|||||||
$.entwine.warningLevel = $.entwine.WARN_LEVEL_BESTPRACTISE;
|
$.entwine.warningLevel = $.entwine.WARN_LEVEL_BESTPRACTISE;
|
||||||
$.entwine.synchronous_mode();
|
$.entwine.synchronous_mode();
|
||||||
|
|
||||||
|
var fixtures = {
|
||||||
|
'tree': '<ul>' +
|
||||||
|
' <li data-id="1">' +
|
||||||
|
' <a href="#">Root node 1</a>' +
|
||||||
|
' <ul>' +
|
||||||
|
' <li data-id="2"><a href="#">Child node 1</a></li>' +
|
||||||
|
' <li data-id="3"><a href="#">Child node 2</a></li>' +
|
||||||
|
' </ul>' +
|
||||||
|
' </li>' +
|
||||||
|
' <li data-id="4"><a href="#">Root node 2</a></li>' +
|
||||||
|
' <li data-id="5"><a href="#">Root node 3</a></li>' +
|
||||||
|
' <li data-id="6"><a href="#">Root node 4</a></li>' +
|
||||||
|
'</ul>',
|
||||||
|
'treesearch': '<ul>' +
|
||||||
|
' <li data-id="1">' +
|
||||||
|
' <a href="#">Root node 1</a>' +
|
||||||
|
' <ul>' +
|
||||||
|
' <li data-id="2"><a href="#">Child node 1</a></li>' +
|
||||||
|
' </ul>' +
|
||||||
|
' </li>' +
|
||||||
|
'</ul>'
|
||||||
|
}
|
||||||
|
|
||||||
// helpers
|
// helpers
|
||||||
var loadTree = function(container, html) {
|
var loadTree = function(container, html) {
|
||||||
if(!html) html = readFixtures('fixtures/tree.html');
|
if(!html) html = fixtures.tree;
|
||||||
container.entwine('ss').loadTree();
|
container.entwine('ss').loadTree();
|
||||||
var request = mostRecentAjaxRequest();
|
var request = mostRecentAjaxRequest();
|
||||||
request.response({
|
request.response({
|
||||||
@ -50,7 +73,7 @@
|
|||||||
request.response({
|
request.response({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'text/html',
|
contentType: 'text/html',
|
||||||
responseText: readFixtures('fixtures/tree.html')
|
responseText: fixtures.tree
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(panel).toContain('ul');
|
expect(panel).toContain('ul');
|
||||||
@ -104,7 +127,7 @@
|
|||||||
request.response({
|
request.response({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'text/html',
|
contentType: 'text/html',
|
||||||
responseText: readFixtures('fixtures/tree.search.html')
|
responseText: fixtures.treesearch
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(panel.text().match('Child node 1')).toBeTruthy();
|
expect(panel.text().match('Child node 1')).toBeTruthy();
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
<div class="TreeDropdownField single" href="/myurl" data-title="Selected">
|
|
||||||
<input type="hidden" name="testfield" value="1" />
|
|
||||||
</div>
|
|
@ -1,22 +0,0 @@
|
|||||||
<ul>
|
|
||||||
<li data-id="1">
|
|
||||||
<a href="#">Root node 1</a>
|
|
||||||
<ul>
|
|
||||||
<li data-id="2">
|
|
||||||
<a href="#">Child node 1</a>
|
|
||||||
</li>
|
|
||||||
<li data-id="3">
|
|
||||||
<a href="#">Child node 2</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li data-id="4">
|
|
||||||
<a href="#">Root node 2</a>
|
|
||||||
</li>
|
|
||||||
<li data-id="5">
|
|
||||||
<a href="#">Root node 3</a>
|
|
||||||
</li>
|
|
||||||
<li data-id="6">
|
|
||||||
<a href="#">Root node 4</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
@ -1,10 +0,0 @@
|
|||||||
<ul>
|
|
||||||
<li data-id="1">
|
|
||||||
<a href="#">Root node 1</a>
|
|
||||||
<ul>
|
|
||||||
<li data-id="2">
|
|
||||||
<a href="#">Child node 1</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
Loading…
Reference in New Issue
Block a user