收口个人中心邀请弹层壳层
RpgEntryHomeView 的 ProfileReferralModal 改用 UnifiedModal 并保留社区与邀请码表单语义 更新玩家社区与邀请码弹层测试的具名 dialog 与关闭路径断言 同步 PlatformUiKit 收口计划与 .hermes 决策记录
This commit is contained in:
@@ -3227,7 +3227,14 @@ test('profile community shortcut shows reward subtitle and invited users', async
|
||||
|
||||
await user.click(communityButton);
|
||||
|
||||
const communityDialog = await screen.findByRole('dialog', {
|
||||
name: '玩家社区',
|
||||
});
|
||||
|
||||
expect(mockGetRpgProfileReferralInviteCenter).toHaveBeenCalledTimes(1);
|
||||
expect(
|
||||
within(communityDialog).getByRole('button', { name: '关闭玩家社区' }),
|
||||
).toBeTruthy();
|
||||
expect(screen.getByAltText('玩家社区微信群二维码')).toBeTruthy();
|
||||
expect(screen.getByAltText('玩家社区 QQ 群二维码')).toBeTruthy();
|
||||
expect(screen.getByText('微信群')).toBeTruthy();
|
||||
@@ -3240,6 +3247,13 @@ test('profile community shortcut shows reward subtitle and invited users', async
|
||||
);
|
||||
expect(screen.queryByText('成功邀请')).toBeNull();
|
||||
expect(screen.queryByText('被邀请玩家')).toBeNull();
|
||||
|
||||
await user.click(
|
||||
within(communityDialog).getByRole('button', { name: '关闭玩家社区' }),
|
||||
);
|
||||
await waitFor(() => {
|
||||
expect(screen.queryByRole('dialog', { name: '玩家社区' })).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
test('profile page hides legacy redeem invite secondary shortcut for fresh accounts', async () => {
|
||||
@@ -3312,6 +3326,7 @@ test('invite query opens redeem modal directly for logged in users', async () =>
|
||||
|
||||
renderProfileView();
|
||||
|
||||
expect(await screen.findByRole('dialog', { name: '填邀请码' })).toBeTruthy();
|
||||
const input = await screen.findByLabelText('邀请码');
|
||||
expect((input as HTMLInputElement).value).toBe('SPRING2026');
|
||||
expect(input.className).toContain('platform-text-field');
|
||||
@@ -3334,6 +3349,7 @@ test('profile redeem invite query modal submits code after login', async () => {
|
||||
|
||||
renderProfileView(onRechargeSuccess, {});
|
||||
|
||||
expect(await screen.findByRole('dialog', { name: '填邀请码' })).toBeTruthy();
|
||||
expect(await screen.findByLabelText('邀请码')).toBeTruthy();
|
||||
await user.click(screen.getByRole('button', { name: '提交' }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user