fix: Allow users to login even if they have access to more than 15 accounts (#4475)

This commit is contained in:
Pranav Raj S
2022-04-14 20:54:26 +05:30
committed by GitHub
parent 80e5d6d7a0
commit 0319b78eac
19 changed files with 368 additions and 350 deletions

View File

@@ -1,7 +1,6 @@
import {
frontendURL,
conversationUrl,
accountIdFromPathname,
isValidURL,
getLoginRedirectURL,
} from '../URLHelper';
@@ -39,18 +38,6 @@ describe('#URL Helpers', () => {
});
});
describe('accountIdFromPathname', () => {
it('should return account id if accont scoped url is passed', () => {
expect(accountIdFromPathname('/app/accounts/1/settings/general')).toBe(1);
});
it('should return empty string if accont scoped url not is passed', () => {
expect(accountIdFromPathname('/app/accounts/settings/general')).toBe('');
});
it('should return empty string if empty string is passed', () => {
expect(accountIdFromPathname('')).toBe('');
});
});
describe('isValidURL', () => {
it('should return true if valid url is passed', () => {
expect(isValidURL('https://chatwoot.com')).toBe(true);
@@ -75,7 +62,7 @@ describe('#URL Helpers', () => {
getLoginRedirectURL('7500', {
accounts: [{ id: '7501', name: 'Test Account 7501' }],
})
).toBe('/app/');
).toBe('/app/accounts/7501/dashboard');
expect(getLoginRedirectURL('7500', null)).toBe('/app/');
});
});