Group events into five temporal sections with section headers, date subheaders, and context-aware time display (clock time for upcoming, relative for past). Includes new useEventGrouping composable, SectionHeader and DateSubheader components, full unit and E2E test coverage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
18 lines
612 B
TypeScript
18 lines
612 B
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { mount } from '@vue/test-utils'
|
|
import DateSubheader from '../DateSubheader.vue'
|
|
|
|
describe('DateSubheader', () => {
|
|
it('renders the date label as an h3', () => {
|
|
const wrapper = mount(DateSubheader, { props: { label: 'Wed, 12 Mar' } })
|
|
const h3 = wrapper.find('h3')
|
|
expect(h3.exists()).toBe(true)
|
|
expect(h3.text()).toBe('Wed, 12 Mar')
|
|
})
|
|
|
|
it('applies the date-subheader class', () => {
|
|
const wrapper = mount(DateSubheader, { props: { label: 'Fri, 14 Mar' } })
|
|
expect(wrapper.find('.date-subheader').exists()).toBe(true)
|
|
})
|
|
})
|