mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
feat: Support dark mode in login pages (#7420)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,6 @@ import {
|
||||
frontendURL,
|
||||
conversationUrl,
|
||||
isValidURL,
|
||||
getLoginRedirectURL,
|
||||
conversationListPageURL,
|
||||
} from '../URLHelper';
|
||||
|
||||
@@ -76,44 +75,4 @@ describe('#URL Helpers', () => {
|
||||
expect(isValidURL('alert.window')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getLoginRedirectURL', () => {
|
||||
it('should return correct Account URL if account id is present', () => {
|
||||
expect(
|
||||
getLoginRedirectURL({
|
||||
ssoAccountId: '7500',
|
||||
user: {
|
||||
accounts: [{ id: 7500, name: 'Test Account 7500' }],
|
||||
},
|
||||
})
|
||||
).toBe('/app/accounts/7500/dashboard');
|
||||
});
|
||||
|
||||
it('should return correct conversation URL if account id and conversationId is present', () => {
|
||||
expect(
|
||||
getLoginRedirectURL({
|
||||
ssoAccountId: '7500',
|
||||
ssoConversationId: '752',
|
||||
user: {
|
||||
accounts: [{ id: 7500, name: 'Test Account 7500' }],
|
||||
},
|
||||
})
|
||||
).toBe('/app/accounts/7500/conversations/752');
|
||||
});
|
||||
|
||||
it('should return default URL if account id is not present', () => {
|
||||
expect(getLoginRedirectURL({ ssoAccountId: '7500', user: {} })).toBe(
|
||||
'/app/'
|
||||
);
|
||||
expect(
|
||||
getLoginRedirectURL({
|
||||
ssoAccountId: '7500',
|
||||
user: {
|
||||
accounts: [{ id: '7501', name: 'Test Account 7501' }],
|
||||
},
|
||||
})
|
||||
).toBe('/app/accounts/7501/dashboard');
|
||||
expect(getLoginRedirectURL('7500', null)).toBe('/app/');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user