statuses unit tests

This commit is contained in:
Henry Jameson 2026-08-18 18:00:36 +03:00
commit 1396eeb71b
23 changed files with 860 additions and 742 deletions

View file

@ -1,17 +1,34 @@
import { defineStore } from 'pinia'
import { useOAuthStore } from 'src/stores/oauth.js'
import { fetchStatusHistory } from 'src/api/public.js'
export const useStatusHistoryStore = defineStore('statusHistory', {
state: () => ({
params: {},
id: null,
modalActivated: false,
history: null,
}),
actions: {
openStatusHistoryModal(params) {
this.params = params
this.modalActivated = true
openModal(id) {
this.fetchStatusHistory(id).then(() => {
this.id = id
this.modalActivated = true
})
},
closeStatusHistoryModal() {
closeModal() {
this.id = null
this.modalActivated = false
this.history = null
},
fetchStatusHistory(id) {
return fetchStatusHistory({
id,
credentials: useOAuthStore().token,
}).then(({ data }) => {
this.history = data
})
},
},
})