Allow users to set where new fields must be created in a record page layout (#18420)
## Demo https://github.com/user-attachments/assets/eaf89d0c-96e0-4e49-ac58-290c8e7403ff
This commit is contained in:
committed by
GitHub
parent
d37ed7e07c
commit
a79b816117
@@ -0,0 +1,38 @@
|
||||
import { isValidReturnToPath } from '@/auth/utils/isValidReturnToPath';
|
||||
|
||||
describe('isValidReturnToPath', () => {
|
||||
it('should return false for empty string', () => {
|
||||
expect(isValidReturnToPath('')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for root path', () => {
|
||||
expect(isValidReturnToPath('/')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for paths not starting with slash', () => {
|
||||
expect(isValidReturnToPath('objects/people')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for double-slash paths', () => {
|
||||
expect(isValidReturnToPath('//evil.com')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for onboarding paths', () => {
|
||||
expect(isValidReturnToPath('/create/workspace')).toBe(false);
|
||||
expect(isValidReturnToPath('/create/profile')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for sign-in paths', () => {
|
||||
expect(isValidReturnToPath('/welcome')).toBe(false);
|
||||
expect(isValidReturnToPath('/verify')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for reset-password paths', () => {
|
||||
expect(isValidReturnToPath('/reset-password')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return true for valid application paths', () => {
|
||||
expect(isValidReturnToPath('/objects/people')).toBe(true);
|
||||
expect(isValidReturnToPath('/settings/accounts')).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user