diff --git a/BTCPayServer.Tests/POSTests.cs b/BTCPayServer.Tests/POSTests.cs index b229525bc..08afdcff5 100644 --- a/BTCPayServer.Tests/POSTests.cs +++ b/BTCPayServer.Tests/POSTests.cs @@ -525,20 +525,20 @@ donation: Assert.Equal("0,56", await s.Page.TextContentAsync("#Amount")); Assert.True(await s.Page.IsEnabledAsync("#ModeTablist-discount")); Assert.True(await s.Page.IsEnabledAsync("#ModeTablist-tip")); - await AssertKeypadCalculation(s, "1.234,00 € + 0,56 € = 1.234,56 €"); + await AssertKeypadCalculation(s, "1.234,00 € + 0,56 €", "1.234,56 €"); // Discount: 10% await s.Page.ClickAsync("label[for='ModeTablist-discount']"); await EnterKeypad(s, "10"); Assert.Contains("0,56", await s.Page.TextContentAsync("#Amount")); Assert.Contains("10% discount", await s.Page.TextContentAsync("#Discount")); - await AssertKeypadCalculation(s, "1.234,00 € + 0,56 € - 123,46 € (10%) = 1.111,10 €"); + await AssertKeypadCalculation(s, "1.234,00 € + 0,56 € - 123,46 € (10%)", "1.111,10 €"); // Tip: 10% await s.Page.ClickAsync("label[for='ModeTablist-tip']"); await s.Page.ClickAsync("#Tip-10"); Assert.Contains("0,56", await s.Page.TextContentAsync("#Amount")); - await AssertKeypadCalculation(s, "1.234,00 € + 0,56 € - 123,46 € (10%) + 111,11 € (10%) = 1.222,21 €"); + await AssertKeypadCalculation(s, "1.234,00 € + 0,56 € - 123,46 € (10%) + 111,11 € (10%)", "1.222,21 €"); // Pay await s.Page.ClickAsync("#pay-button"); @@ -581,7 +581,7 @@ donation: await EnterKeypad(s, "123"); Assert.Contains("1,23", await s.Page.TextContentAsync("#Amount")); - await AssertKeypadCalculation(s, "2 x Green Tea (1,00 €) = 2,00 € + 1 x Black Tea (1,00 €) = 1,00 € + 1,23 € + 0,42 € (10%) = 4,65 €"); + await AssertKeypadCalculation(s, "2 x Green Tea (1,00 €) = 2,00 € + 1 x Black Tea (1,00 €) = 1,00 € + 1,23 € + 0,42 € (10%)", "4,65 €"); // Pay await s.Page.ClickAsync("#pay-button"); @@ -632,9 +632,10 @@ donation: Assert.Contains("1,35 €", await s.Page.TextContentAsync("#PaymentDetails-TotalFiat")); } - private static async Task AssertKeypadCalculation(PlaywrightTester s, string expected) + private static async Task AssertKeypadCalculation(PlaywrightTester s, string expectedCalculation, string expectedTotal) { - Assert.Equal(expected.NormalizeWhitespaces(), (await s.Page.TextContentAsync("#Calculation")).NormalizeWhitespaces()); + Assert.Equal(expectedCalculation.NormalizeWhitespaces(), (await s.Page.TextContentAsync("#Calculation")).NormalizeWhitespaces()); + Assert.Equal(("Total: " + expectedTotal).NormalizeWhitespaces(), (await s.Page.TextContentAsync("#Total")).NormalizeWhitespaces()); } public class AssertReceiptAssertion diff --git a/BTCPayServer/Views/Shared/PointOfSale/Public/VueLight.cshtml b/BTCPayServer/Views/Shared/PointOfSale/Public/VueLight.cshtml index af9d470f2..be3b418c4 100644 --- a/BTCPayServer/Views/Shared/PointOfSale/Public/VueLight.cshtml +++ b/BTCPayServer/Views/Shared/PointOfSale/Public/VueLight.cshtml @@ -23,6 +23,7 @@