mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Fix tests
This commit is contained in:
@@ -427,6 +427,7 @@ namespace BTCPayServer.Tests
|
|||||||
{
|
{
|
||||||
if (storeId is null)
|
if (storeId is null)
|
||||||
{
|
{
|
||||||
|
var aaa = this.Driver.PageSource;
|
||||||
this.Driver.FindElement(By.Id("StoreNav-Invoices")).Click();
|
this.Driver.FindElement(By.Id("StoreNav-Invoices")).Click();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -150,8 +150,8 @@ namespace BTCPayServer.Tests
|
|||||||
s.Driver.AssertNoError();
|
s.Driver.AssertNoError();
|
||||||
Assert.Contains("/login", s.Driver.Url);
|
Assert.Contains("/login", s.Driver.Url);
|
||||||
|
|
||||||
s.GoToUrl("/invoices");
|
s.GoToUrl("/Manage/Index");
|
||||||
Assert.Contains("ReturnUrl=%2Finvoices", s.Driver.Url);
|
Assert.Contains("ReturnUrl=%2FManage%2FIndex", s.Driver.Url);
|
||||||
|
|
||||||
// We should be redirected to login
|
// We should be redirected to login
|
||||||
//Same User Can Log Back In
|
//Same User Can Log Back In
|
||||||
@@ -160,7 +160,7 @@ namespace BTCPayServer.Tests
|
|||||||
s.Driver.FindElement(By.Id("LoginButton")).Click();
|
s.Driver.FindElement(By.Id("LoginButton")).Click();
|
||||||
|
|
||||||
// We should be redirected to invoice
|
// We should be redirected to invoice
|
||||||
Assert.EndsWith("/invoices", s.Driver.Url);
|
Assert.EndsWith("/Manage/Index", s.Driver.Url);
|
||||||
|
|
||||||
// Should not be able to reach server settings
|
// Should not be able to reach server settings
|
||||||
s.GoToUrl("/server/users");
|
s.GoToUrl("/server/users");
|
||||||
|
|||||||
@@ -746,7 +746,7 @@ namespace BTCPayServer.Controllers
|
|||||||
|
|
||||||
[HttpGet("/stores/{storeId}/invoices")]
|
[HttpGet("/stores/{storeId}/invoices")]
|
||||||
[HttpGet("invoices")]
|
[HttpGet("invoices")]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie, Policy = Policies.CanViewInvoices)]
|
||||||
[BitpayAPIConstraint(false)]
|
[BitpayAPIConstraint(false)]
|
||||||
public async Task<IActionResult> ListInvoices(InvoicesModel? model = null)
|
public async Task<IActionResult> ListInvoices(InvoicesModel? model = null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user