removed the old event admin components and pages
This commit is contained in:
21
resources/js/admin/mobile/__tests__/eventDetail.test.ts
Normal file
21
resources/js/admin/mobile/__tests__/eventDetail.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { isPastEvent } from '../eventDate';
|
||||
|
||||
describe('isPastEvent', () => {
|
||||
it('detects past dates', () => {
|
||||
const past = new Date();
|
||||
past.setDate(past.getDate() - 2);
|
||||
expect(isPastEvent(past.toISOString())).toBe(true);
|
||||
});
|
||||
|
||||
it('detects future dates', () => {
|
||||
const future = new Date();
|
||||
future.setDate(future.getDate() + 2);
|
||||
expect(isPastEvent(future.toISOString())).toBe(false);
|
||||
});
|
||||
|
||||
it('handles invalid input', () => {
|
||||
expect(isPastEvent(undefined)).toBe(false);
|
||||
expect(isPastEvent('not-a-date')).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user