Skip to content

Commit

Permalink
fix tests on older Haxe
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Mar 11, 2024
1 parent 50bfc07 commit e9f1fca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
17 changes: 11 additions & 6 deletions test/src/feathers/controls/TreeGridViewTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,10 @@ import utest.Test;
var item1 = {a: "A0-a"};
var item2 = {a: "A0-b"};
var item3 = {a: "A0-c"};
var branch = {a: "A0", children: [item1, item2, item3]};
this._treeGridView.dataProvider = new ArrayHierarchicalCollection([branch, {a: "A1"}], (item:Dynamic) -> item.children);
var children:Array<Dynamic> = [item1, item2, item3];
var branch = {a: "A0", children: children};
var items:Array<Dynamic> = [branch, {a: "A1"}];
this._treeGridView.dataProvider = new ArrayHierarchicalCollection(items, (item:Dynamic) -> item.children);
this._treeGridView.columns = new ArrayCollection([new TreeGridViewColumn("A", item -> item.a)]);
var item = this._treeGridView.dataProvider.get([1]);
var column = this._treeGridView.columns.get(0);
Expand All @@ -911,10 +913,13 @@ import utest.Test;
}

private function testDispatchItemTriggerFromTouchTap():Void {
this._treeGridView.dataProvider = new ArrayHierarchicalCollection([
{text: "A", children: [{text: "One"}, {text: "Two"}, {text: "Three"}]},
{text: "B"}
], (item:Dynamic) -> item.children);
var item1 = {a: "A0-a"};
var item2 = {a: "A0-b"};
var item3 = {a: "A0-c"};
var children:Array<Dynamic> = [item1, item2, item3];
var branch = {a: "A0", children: children};
var items:Array<Dynamic> = [branch, {a: "A1"}];
this._treeGridView.dataProvider = new ArrayHierarchicalCollection(items, (item:Dynamic) -> item.children);
this._treeGridView.columns = new ArrayCollection([new TreeGridViewColumn("A", item -> item.a)]);
var item = this._treeGridView.dataProvider.get([1]);
var column = this._treeGridView.columns.get(0);
Expand Down
14 changes: 6 additions & 8 deletions test/src/feathers/controls/TreeViewTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -798,10 +798,9 @@ import utest.Test;
}

private function testDispatchItemTriggerFromMouseClick():Void {
this._treeView.dataProvider = new ArrayHierarchicalCollection([
{text: "A", children: [{text: "One"}, {text: "Two"}, {text: "Three"}]},
{text: "B"}
], (item:Dynamic) -> item.children);
var children:Array<Dynamic> = [{text: "One"}, {text: "Two"}, {text: "Three"}];
var items:Array<Dynamic> = [{text: "A", children: children}, {text: "B"}];
this._treeView.dataProvider = new ArrayHierarchicalCollection(items, (item:Dynamic) -> item.children);
var item = this._treeView.dataProvider.get([1]);
this._treeView.validateNow();
var itemRenderer = cast(this._treeView.itemToItemRenderer(item), HierarchicalItemRenderer);
Expand All @@ -817,10 +816,9 @@ import utest.Test;
}

private function testDispatchItemTriggerFromTouchTap():Void {
this._treeView.dataProvider = new ArrayHierarchicalCollection([
{text: "A", children: [{text: "One"}, {text: "Two"}, {text: "Three"}]},
{text: "B"}
], (item:Dynamic) -> item.children);
var children:Array<Dynamic> = [{text: "One"}, {text: "Two"}, {text: "Three"}];
var items:Array<Dynamic> = [{text: "A", children: children}, {text: "B"}];
this._treeView.dataProvider = new ArrayHierarchicalCollection(items, (item:Dynamic) -> item.children);
var item = this._treeView.dataProvider.get([1]);
this._treeView.validateNow();
var itemRenderer = cast(this._treeView.itemToItemRenderer(item), HierarchicalItemRenderer);
Expand Down

0 comments on commit e9f1fca

Please sign in to comment.