mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
30 lines
706 B
TypeScript
30 lines
706 B
TypeScript
import { setActivePinia, createPinia } from 'pinia'
|
|
import { describe, it, expect, beforeEach } from 'vitest'
|
|
|
|
import { useCounterStore } from './counter'
|
|
|
|
describe('Counter Store', () => {
|
|
beforeEach(() => {
|
|
setActivePinia(createPinia())
|
|
})
|
|
|
|
describe('increment', () => {
|
|
it('increments', () => {
|
|
const counter = useCounterStore()
|
|
expect(counter.count).toBe(0)
|
|
counter.increment()
|
|
expect(counter.count).toBe(1)
|
|
})
|
|
})
|
|
|
|
describe('resets', () => {
|
|
it('increments by amount', () => {
|
|
const counter = useCounterStore()
|
|
counter.increment()
|
|
expect(counter.count).toBe(1)
|
|
counter.reset()
|
|
expect(counter.count).toBe(0)
|
|
})
|
|
})
|
|
})
|