mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
refactor : addressed requested changes
Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
This commit is contained in:
@@ -2548,8 +2548,8 @@ namespace BTCPayServer.Tests
|
|||||||
await employeeRow.Locator("a[data-bs-target='#EditModal']").ClickAsync();
|
await employeeRow.Locator("a[data-bs-target='#EditModal']").ClickAsync();
|
||||||
Assert.Equal(employee, await s.Page.Locator("#EditUserEmail").InnerTextAsync());
|
Assert.Equal(employee, await s.Page.Locator("#EditUserEmail").InnerTextAsync());
|
||||||
await s.Page.Locator("#EditUserRole").SelectOptionAsync("Manager");
|
await s.Page.Locator("#EditUserRole").SelectOptionAsync("Manager");
|
||||||
await s.Page.Locator("#EditContinue").ClickAsync();
|
await s.Page.ClickAsync("#EditContinue");
|
||||||
Assert.Contains($"The role of {employee} has been changed to Manager.", await (await s.FindAlertMessage()).InnerTextAsync());
|
await s.FindAlertMessage(partialText: $"The role of {employee} has been changed to Manager.");
|
||||||
|
|
||||||
// Should not see a message when not changing role
|
// Should not see a message when not changing role
|
||||||
userRows = await s.Page.Locator("#StoreUsersList tr").AllAsync();
|
userRows = await s.Page.Locator("#StoreUsersList tr").AllAsync();
|
||||||
@@ -2562,8 +2562,8 @@ namespace BTCPayServer.Tests
|
|||||||
Assert.NotNull(employeeRow);
|
Assert.NotNull(employeeRow);
|
||||||
await employeeRow.Locator("a[data-bs-target='#EditModal']").ClickAsync();
|
await employeeRow.Locator("a[data-bs-target='#EditModal']").ClickAsync();
|
||||||
Assert.Equal(employee, await s.Page.Locator("#EditUserEmail").InnerTextAsync());
|
Assert.Equal(employee, await s.Page.Locator("#EditUserEmail").InnerTextAsync());
|
||||||
await s.Page.Locator("#EditContinue").ClickAsync();
|
await s.Page.ClickAsync("#EditContinue");
|
||||||
Assert.Contains("The user already has the role Manager.", await (await s.FindAlertMessage(StatusMessageModel.StatusSeverity.Error)).InnerTextAsync());
|
await s.FindAlertMessage(StatusMessageModel.StatusSeverity.Error, "The user already has the role Manager.");
|
||||||
|
|
||||||
// Should not change last owner
|
// Should not change last owner
|
||||||
userRows = await s.Page.Locator("#StoreUsersList tr").AllAsync();
|
userRows = await s.Page.Locator("#StoreUsersList tr").AllAsync();
|
||||||
@@ -2577,8 +2577,8 @@ namespace BTCPayServer.Tests
|
|||||||
await ownerRow.Locator("a[data-bs-target='#EditModal']").ClickAsync();
|
await ownerRow.Locator("a[data-bs-target='#EditModal']").ClickAsync();
|
||||||
Assert.Equal(owner, await s.Page.Locator("#EditUserEmail").InnerTextAsync());
|
Assert.Equal(owner, await s.Page.Locator("#EditUserEmail").InnerTextAsync());
|
||||||
await s.Page.Locator("#EditUserRole").SelectOptionAsync("Employee");
|
await s.Page.Locator("#EditUserRole").SelectOptionAsync("Employee");
|
||||||
await s.Page.Locator("#EditContinue").ClickAsync();
|
await s.Page.ClickAsync("#EditContinue");
|
||||||
Assert.Contains("The user is the last owner. Their role cannot be changed.", await (await s.FindAlertMessage(StatusMessageModel.StatusSeverity.Error)).InnerTextAsync());
|
await s.FindAlertMessage(StatusMessageModel.StatusSeverity.Error, "The user is the last owner. Their role cannot be changed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user