1
This commit is contained in:
@@ -118,7 +118,7 @@ describe('authService', () => {
|
||||
'登录失败',
|
||||
);
|
||||
expect(getStoredAccessToken()).toBe('jwt-entry-token');
|
||||
expect(window.dispatchEvent).toHaveBeenCalledTimes(1);
|
||||
expect(window.dispatchEvent).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('creates a fresh guest credential pair for auto auth when a session is missing', async () => {
|
||||
@@ -251,7 +251,7 @@ describe('authService', () => {
|
||||
'登录失败',
|
||||
);
|
||||
expect(getStoredAccessToken()).toBe('jwt-phone-token');
|
||||
expect(window.dispatchEvent).toHaveBeenCalledTimes(1);
|
||||
expect(window.dispatchEvent).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('stores renewed access token after wechat bind activation', async () => {
|
||||
@@ -272,7 +272,7 @@ describe('authService', () => {
|
||||
|
||||
expect(user.wechatBound).toBe(true);
|
||||
expect(getStoredAccessToken()).toBe('jwt-wechat-bind-token');
|
||||
expect(window.dispatchEvent).toHaveBeenCalledTimes(1);
|
||||
expect(window.dispatchEvent).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('changes phone number without emitting a global auth state refresh', async () => {
|
||||
@@ -367,7 +367,7 @@ describe('authService', () => {
|
||||
error: null,
|
||||
});
|
||||
expect(getStoredAccessToken()).toBe('jwt-callback-token');
|
||||
expect(window.dispatchEvent).toHaveBeenCalledTimes(1);
|
||||
expect(window.dispatchEvent).not.toHaveBeenCalled();
|
||||
expect(replaceStateMock).toHaveBeenCalledWith(null, '', '/');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user