- Added new dependencies: `adler2`, `crc32fast`, `flate2`, `miniz_oxide`, and `libredox`. - Updated existing dependencies: `tokio-rustls` to version 0.26.4 and `filetime` to version 0.2.27. - Removed the `backup.rs` file as it is no longer needed. - Introduced tests for configuration and credential management. - Enhanced the `identity` module to generate W3C compliant DID documents. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
import { describe, it, expect, beforeEach } from 'vitest'
|
|
import { setActivePinia, createPinia } from 'pinia'
|
|
import { useLoginTransitionStore } from '../loginTransition'
|
|
|
|
describe('useLoginTransitionStore', () => {
|
|
beforeEach(() => {
|
|
setActivePinia(createPinia())
|
|
})
|
|
|
|
it('starts with all flags false', () => {
|
|
const store = useLoginTransitionStore()
|
|
expect(store.justLoggedIn).toBe(false)
|
|
expect(store.pendingWelcomeTyping).toBe(false)
|
|
expect(store.startWelcomeTyping).toBe(false)
|
|
})
|
|
|
|
it('setJustLoggedIn updates justLoggedIn', () => {
|
|
const store = useLoginTransitionStore()
|
|
store.setJustLoggedIn(true)
|
|
expect(store.justLoggedIn).toBe(true)
|
|
store.setJustLoggedIn(false)
|
|
expect(store.justLoggedIn).toBe(false)
|
|
})
|
|
|
|
it('setPendingWelcomeTyping updates pendingWelcomeTyping', () => {
|
|
const store = useLoginTransitionStore()
|
|
store.setPendingWelcomeTyping(true)
|
|
expect(store.pendingWelcomeTyping).toBe(true)
|
|
store.setPendingWelcomeTyping(false)
|
|
expect(store.pendingWelcomeTyping).toBe(false)
|
|
})
|
|
|
|
it('setStartWelcomeTyping updates startWelcomeTyping', () => {
|
|
const store = useLoginTransitionStore()
|
|
store.setStartWelcomeTyping(true)
|
|
expect(store.startWelcomeTyping).toBe(true)
|
|
store.setStartWelcomeTyping(false)
|
|
expect(store.startWelcomeTyping).toBe(false)
|
|
})
|
|
|
|
it('flags are independent of each other', () => {
|
|
const store = useLoginTransitionStore()
|
|
store.setJustLoggedIn(true)
|
|
store.setPendingWelcomeTyping(true)
|
|
expect(store.startWelcomeTyping).toBe(false)
|
|
|
|
store.setStartWelcomeTyping(true)
|
|
store.setJustLoggedIn(false)
|
|
expect(store.pendingWelcomeTyping).toBe(true)
|
|
expect(store.startWelcomeTyping).toBe(true)
|
|
})
|
|
})
|