Fix tests

This commit is contained in:
nicolas.dorier 2022-01-13 23:50:33 +09:00
parent 127afdb5c1
commit 223c71ce8b
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
3 changed files with 5 additions and 4 deletions

View File

@ -427,6 +427,7 @@ namespace BTCPayServer.Tests
{
if (storeId is null)
{
var aaa = this.Driver.PageSource;
this.Driver.FindElement(By.Id("StoreNav-Invoices")).Click();
}
else

View File

@ -150,8 +150,8 @@ namespace BTCPayServer.Tests
s.Driver.AssertNoError();
Assert.Contains("/login", s.Driver.Url);
s.GoToUrl("/invoices");
Assert.Contains("ReturnUrl=%2Finvoices", s.Driver.Url);
s.GoToUrl("/Manage/Index");
Assert.Contains("ReturnUrl=%2FManage%2FIndex", s.Driver.Url);
// We should be redirected to login
//Same User Can Log Back In
@ -160,7 +160,7 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("LoginButton")).Click();
// 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
s.GoToUrl("/server/users");

View File

@ -746,7 +746,7 @@ namespace BTCPayServer.Controllers
[HttpGet("/stores/{storeId}/invoices")]
[HttpGet("invoices")]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie, Policy = Policies.CanViewInvoices)]
[BitpayAPIConstraint(false)]
public async Task<IActionResult> ListInvoices(InvoicesModel? model = null)
{