mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
fix CanExportInvoicesJson
This commit is contained in:
parent
0098dacdff
commit
5d2b42960b
@ -447,9 +447,12 @@ namespace BTCPayServer.Tests
|
|||||||
s.AddDerivationScheme();
|
s.AddDerivationScheme();
|
||||||
s.GoToInvoices();
|
s.GoToInvoices();
|
||||||
var i = s.CreateInvoice();
|
var i = s.CreateInvoice();
|
||||||
s.GoToInvoiceCheckout(i);
|
await s.Server.PayTester.InvoiceRepository.MarkInvoiceStatus(i, InvoiceStatus.Settled);
|
||||||
s.PayInvoice(true);
|
TestUtils.Eventually(() =>
|
||||||
TestUtils.Eventually(() => s.Driver.FindElement(By.LinkText("View receipt")).Click());
|
{
|
||||||
|
s.Driver.Navigate().Refresh();
|
||||||
|
s.Driver.FindElement(By.Id($"Receipt")).Click();
|
||||||
|
});
|
||||||
TestUtils.Eventually(() =>
|
TestUtils.Eventually(() =>
|
||||||
{
|
{
|
||||||
s.Driver.Navigate().Refresh();
|
s.Driver.Navigate().Refresh();
|
||||||
@ -472,7 +475,11 @@ namespace BTCPayServer.Tests
|
|||||||
s.GoToInvoiceCheckout(i);
|
s.GoToInvoiceCheckout(i);
|
||||||
var checkouturi = s.Driver.Url;
|
var checkouturi = s.Driver.Url;
|
||||||
s.PayInvoice();
|
s.PayInvoice();
|
||||||
TestUtils.Eventually(() => s.Driver.FindElement(By.LinkText("View receipt")).Click());
|
TestUtils.Eventually(() =>
|
||||||
|
{
|
||||||
|
s.Driver.Navigate().Refresh();
|
||||||
|
s.Driver.FindElement(By.Id("receipt-btn")).Click();
|
||||||
|
});
|
||||||
TestUtils.Eventually(() =>
|
TestUtils.Eventually(() =>
|
||||||
{
|
{
|
||||||
s.Driver.Navigate().Refresh();
|
s.Driver.Navigate().Refresh();
|
||||||
@ -483,7 +490,7 @@ namespace BTCPayServer.Tests
|
|||||||
|
|
||||||
await s.Server.PayTester.InvoiceRepository.MarkInvoiceStatus(i, InvoiceStatus.Settled);
|
await s.Server.PayTester.InvoiceRepository.MarkInvoiceStatus(i, InvoiceStatus.Settled);
|
||||||
|
|
||||||
TestUtils.Eventually(() => s.Driver.FindElement(By.LinkText("View receipt")).Click());
|
TestUtils.Eventually(() => s.Driver.FindElement(By.Id("receipt-btn")).Click());
|
||||||
TestUtils.Eventually(() =>
|
TestUtils.Eventually(() =>
|
||||||
{
|
{
|
||||||
s.Driver.Navigate().Refresh();
|
s.Driver.Navigate().Refresh();
|
||||||
|
@ -1765,11 +1765,10 @@ namespace BTCPayServer.Tests
|
|||||||
}, Facade.Merchant);
|
}, Facade.Merchant);
|
||||||
|
|
||||||
var networkFee = new FeeRate(invoice.MinerFees["BTC"].SatoshiPerBytes).GetFee(100);
|
var networkFee = new FeeRate(invoice.MinerFees["BTC"].SatoshiPerBytes).GetFee(100);
|
||||||
// ensure 0 invoices exported because there are no payments yet
|
|
||||||
var jsonResult = user.GetController<UIInvoiceController>().Export("json").GetAwaiter().GetResult();
|
var jsonResult = user.GetController<UIInvoiceController>().Export("json").GetAwaiter().GetResult();
|
||||||
var result = Assert.IsType<ContentResult>(jsonResult);
|
var result = Assert.IsType<ContentResult>(jsonResult);
|
||||||
Assert.Equal("application/json", result.ContentType);
|
Assert.Equal("application/json", result.ContentType);
|
||||||
Assert.Equal("[]", result.Content);
|
Assert.Equal(1, JArray.Parse(result.Content).Count);
|
||||||
|
|
||||||
var cashCow = tester.ExplorerNode;
|
var cashCow = tester.ExplorerNode;
|
||||||
var invoiceAddress = BitcoinAddress.Create(invoice.CryptoInfo[0].Address, cashCow.Network);
|
var invoiceAddress = BitcoinAddress.Create(invoice.CryptoInfo[0].Address, cashCow.Network);
|
||||||
|
@ -206,10 +206,10 @@
|
|||||||
<div class="success-message">{{$t("This invoice has been paid")}}</div>
|
<div class="success-message">{{$t("This invoice has been paid")}}</div>
|
||||||
<a class="action-button" :href="srvModel.merchantRefLink" v-if="!isModal && srvModel.merchantRefLink">
|
<a class="action-button" :href="srvModel.merchantRefLink" v-if="!isModal && srvModel.merchantRefLink">
|
||||||
<span v-if="srvModel.receiptLink != srvModel.merchantRefLink" v-html="$t('Return to StoreName', srvModel)"></span>
|
<span v-if="srvModel.receiptLink != srvModel.merchantRefLink" v-html="$t('Return to StoreName', srvModel)"></span>
|
||||||
<span v-else v-html="$t('View receipt')"></span>
|
<span v-else v-html="$t('View receipt')" id="receipt-btn"></span>
|
||||||
</a>
|
</a>
|
||||||
<a class="action-button" :href="srvModel.receiptLink" :target="isModal?'_blank':'_top'" v-if="srvModel.receiptLink && (srvModel.merchantRefLink != srvModel.receiptLink) || isModal">
|
<a class="action-button" :href="srvModel.receiptLink" :target="isModal?'_blank':'_top'" v-if="srvModel.receiptLink && (srvModel.merchantRefLink != srvModel.receiptLink) || isModal">
|
||||||
<span v-html="$t('View receipt')"></span>
|
<span v-html="$t('View receipt')" id="receipt-btn"></span>
|
||||||
</a>
|
</a>
|
||||||
<button class="action-button close-action" v-show="isModal" v-on:click="close">
|
<button class="action-button close-action" v-show="isModal" v-on:click="close">
|
||||||
<span v-html="$t('Close')"></span>
|
<span v-html="$t('Close')"></span>
|
||||||
|
Loading…
Reference in New Issue
Block a user