Skip to content

Commit

Permalink
Fixed issue with translation of dotvvm.api.isLoading
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasherceg authored and exyi committed Mar 22, 2023
1 parent 4b18f82 commit 25d391f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void RegisterJavascriptTranslations(JavascriptTranslatableMethodCo
));
methods.AddPropertyGetterTranslator(typeof(BindingApi), nameof(IsLoading),
new GenericMethodCompiler(a =>
new JsIdentifierExpression("dotvvm").Member("api").Member("isLoading").Invoke()
new JsIdentifierExpression("dotvvm").Member("api").Member("isLoading")
.WithAnnotation(ResultIsObservableAnnotation.Instance)));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</div>

<div data-ui="loading" Visible="{value: _api.IsLoading}">LOADING</div>
<div data-ui="not-loading" Visible="{value: !_api.IsLoading}">NOT LOADING</div>

</body>
</html>
Expand Down
6 changes: 6 additions & 0 deletions src/Samples/Tests/Tests/Feature/ApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,21 +506,27 @@ public void Feature_Api_IsLoading()
browser.NavigateToUrl(SamplesRouteUrls.FeatureSamples_Api_IsLoading);
var loading = browser.Single("loading", SelectByDataUi);
var notLoading = browser.Single("not-loading", SelectByDataUi);
AssertUI.IsNotDisplayed(loading);
AssertUI.IsDisplayed(notLoading);
browser.Single("number1", SelectByDataUi).Single("input[type=button]").Click();
AssertUI.IsDisplayed(loading);
AssertUI.IsNotDisplayed(notLoading);
Thread.Sleep(500);
browser.Single("number2", SelectByDataUi).Single("input[type=button]").Click();
AssertUI.IsDisplayed(loading);
AssertUI.IsNotDisplayed(notLoading);
Thread.Sleep(500);
browser.Single("number3", SelectByDataUi).Single("input[type=button]").Click();
AssertUI.IsDisplayed(loading);
AssertUI.IsNotDisplayed(notLoading);
Thread.Sleep(3000);
AssertUI.IsNotDisplayed(loading);
AssertUI.IsDisplayed(notLoading);
});
}

Expand Down

0 comments on commit 25d391f

Please sign in to comment.