Skip to content

Commit

Permalink
Refined UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasherceg committed Feb 23, 2024
1 parent 6d676be commit 47ba7e2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
@viewModel System.String, mscorlib
@baseType DotVVM.Samples.Common.Views.FeatureSamples.MarkupControl.CommandAsProperty, DotVVM.Samples.Common

<%-- When uncommented, it produces an error --%>
<%-- In Release mode, the error that is really hard to debug (maybe it was caused because the control was loaded from embedded resource). --%>
<%--<dot:Button Text="{value: _this}" Click="{command: _control.Click}" />--%>


<%--The following with ToString works somehow and I am not sure by what magic--%>
<%-- both options are legit --%>
<dot:Button Text="{value: _this}" Click="{command: _control.Click}" />
<dot:Button Text="{value: _this}" Click="{staticCommand: _control.Click}" />
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<cc:CommandAsPropertyWrapper Click="{command: (string name, bool isTrue) => _root.MyFunction(name, isTrue)}" />
<hr />

<%--<h1>Pass as static command</h1>
<cc:CommandAsPropertyWrapper Click="{staticCommand: (string name, bool isTrue) => (_root.Name = name; _root.IsTrue = isTrue)}" />
<hr />--%>
<h1>Pass as static command</h1>
<cc:CommandAsPropertyWrapper Click="{staticCommand: (string name, bool isTrue) => (_root.SelectedItem.Name = name; _root.SelectedItem.IsTrue = isTrue)}" />
<hr />

<%--<h1>Pass as value</h1>
<cc:CommandAsPropertyWrapper Click="{value: (string name, bool isTrue) => _root.MyFunction(name, isTrue)}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<h2>Passed as static command</h2>
<cc:CommandAsProperty Click="{staticCommand: _control.Click(_parent.Name, _parent.IsTrue)}" DataContext="{value: Name}" />
</div>

<%-- remove after we fix the lambda conversion --%>
<div>
<h2>Passed as value</h2>
<cc:CommandAsProperty Click="{value: _control.Click(_parent.Name, _parent.IsTrue)}" DataContext="{value: Name}" />
Expand Down

0 comments on commit 47ba7e2

Please sign in to comment.