test(lists): add boundary and fragment tests for extractListId
- Test that 5-digit IDs (minimum length) are accepted - Test that URLs with fragment identifiers work correctly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
committed by
Peter Steinberger
co-authored by
Claude Opus 4.5
parent
59e827e153
commit
0e8a1349c5
@@ -95,8 +95,17 @@ describe('CLI utilities', () => {
|
|||||||
expect(extractListId('1234')).toBeNull();
|
expect(extractListId('1234')).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should accept minimum 5-digit IDs', () => {
|
||||||
|
expect(extractListId('12345')).toBe('12345');
|
||||||
|
});
|
||||||
|
|
||||||
it('should trim whitespace from input', () => {
|
it('should trim whitespace from input', () => {
|
||||||
expect(extractListId(' 1234567890123456789 ')).toBe('1234567890123456789');
|
expect(extractListId(' 1234567890123456789 ')).toBe('1234567890123456789');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should extract ID from URL with fragment', () => {
|
||||||
|
const url = 'https://x.com/i/lists/1234567890123456789#section';
|
||||||
|
expect(extractListId(url)).toBe('1234567890123456789');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user