mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-23 14:15:23 +00:00
profilelink (#4661)
## Description: <img width="930" height="755" alt="image" src="https://github.com/user-attachments/assets/f606bdce-fbeb-4fc3-98fb-ba6622634350" /> <img width="875" height="368" alt="image" src="https://github.com/user-attachments/assets/81c8243d-5dc0-4687-bed4-cadb6bafb808" /> ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory ## Please put your Discord username so you can be contacted if a bug or regression is found: w.o.n
This commit is contained in:
@@ -159,18 +159,20 @@ describe("public player profile route", () => {
|
||||
expect(fetchPublicPlayerProfileMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("returns to the clan members tab when opened from a clan", async () => {
|
||||
it("hands back to the clan modal when opened from a clan", async () => {
|
||||
fetchPublicPlayerProfileMock.mockResolvedValue({
|
||||
createdAt: "2026-01-01T00:00:00.000Z",
|
||||
stats: statsTree,
|
||||
});
|
||||
const returnToMembers = vi.fn();
|
||||
// The clan modal decides which tab to restore (Members vs Game History)
|
||||
// via returnFromPlayerProfile — the profile modal just hands back to it.
|
||||
const returnFromPlayerProfile = vi.fn();
|
||||
const fakeClanModal = document.createElement(
|
||||
"clan-modal",
|
||||
) as HTMLElement & {
|
||||
returnToMembers: () => void;
|
||||
returnFromPlayerProfile: () => void;
|
||||
};
|
||||
fakeClanModal.returnToMembers = returnToMembers;
|
||||
fakeClanModal.returnFromPlayerProfile = returnFromPlayerProfile;
|
||||
document.body.appendChild(fakeClanModal);
|
||||
|
||||
modal.openFromClan("clan-member");
|
||||
@@ -183,7 +185,7 @@ describe("public player profile route", () => {
|
||||
backButton.click();
|
||||
|
||||
expect(modal.isOpen()).toBe(false);
|
||||
expect(returnToMembers).toHaveBeenCalled();
|
||||
expect(returnFromPlayerProfile).toHaveBeenCalled();
|
||||
fakeClanModal.remove();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user