fix frontend issues
This commit is contained in:
Generated
-30
@@ -579,9 +579,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -599,9 +596,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -619,9 +613,6 @@
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -639,9 +630,6 @@
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -659,9 +647,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -679,9 +664,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2509,9 +2491,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2533,9 +2512,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2557,9 +2533,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2581,9 +2554,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
|
||||
@@ -107,7 +107,6 @@ describe('EntryForm', () => {
|
||||
const wrapper = mount(EntryForm, {
|
||||
props: { batch: makeBatch(), batchId: 'b1' },
|
||||
})
|
||||
const submitBtn = wrapper.find('button')
|
||||
const buttons = wrapper.findAll('button')
|
||||
const submitButton = buttons.find((b) => b.text().includes('Submit for Verification'))
|
||||
expect(submitButton).toBeTruthy()
|
||||
@@ -172,7 +171,6 @@ describe('EntryForm', () => {
|
||||
store.currentDraft = emptyDraft('VITALS', {
|
||||
patient: {
|
||||
id: 'dp1',
|
||||
batchId: 'b1',
|
||||
fullName: 'John Doe',
|
||||
dateOfBirth: '1990-05-15',
|
||||
sex: 'male',
|
||||
@@ -188,7 +186,7 @@ describe('EntryForm', () => {
|
||||
})
|
||||
await wrapper.vm.$nextTick()
|
||||
|
||||
const nameInput = wrapper.find('input[type="text"]')
|
||||
const nameInput = wrapper.find<HTMLInputElement>('input[type="text"]')
|
||||
expect(nameInput.element.value).toBe('John Doe')
|
||||
})
|
||||
})
|
||||
@@ -271,7 +269,7 @@ describe('EntryForm', () => {
|
||||
|
||||
const store = useBatchStore()
|
||||
store.submitForVerification = vi.fn().mockReturnValue(
|
||||
new Promise((resolve) => {
|
||||
new Promise<void>((resolve) => {
|
||||
resolvePromise = resolve
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@ describe('ObservationRow', () => {
|
||||
const wrapper = mount(ObservationRow, {
|
||||
props: { observation: makeObservation() },
|
||||
})
|
||||
const options = wrapper.findAll('select option')
|
||||
const options = wrapper.findAll<HTMLOptionElement>('select option')
|
||||
const values = options.map((o) => o.element.value)
|
||||
expect(values).toContain('HEART_RATE')
|
||||
expect(values).toContain('TEMP_C')
|
||||
@@ -34,10 +34,10 @@ describe('ObservationRow', () => {
|
||||
const wrapper = mount(ObservationRow, {
|
||||
props: { observation: makeObservation({ value: 98.6, unit: '°F' }) },
|
||||
})
|
||||
const numberInput = wrapper.find('input[type="number"]')
|
||||
const numberInput = wrapper.find<HTMLInputElement>('input[type="number"]')
|
||||
expect(numberInput.element.value).toBe('98.6')
|
||||
|
||||
const textInputs = wrapper.findAll('input[type="text"]')
|
||||
const textInputs = wrapper.findAll<HTMLInputElement>('input[type="text"]')
|
||||
const unitInput = textInputs[0]
|
||||
expect(unitInput.element.value).toBe('°F')
|
||||
})
|
||||
@@ -93,7 +93,7 @@ describe('ObservationRow', () => {
|
||||
const select = wrapper.find('select')
|
||||
expect(select.element.disabled).toBe(true)
|
||||
|
||||
const numberInput = wrapper.find('input[type="number"]')
|
||||
const numberInput = wrapper.find<HTMLInputElement>('input[type="number"]')
|
||||
expect(numberInput.element.disabled).toBe(true)
|
||||
})
|
||||
|
||||
@@ -114,7 +114,7 @@ describe('ObservationRow', () => {
|
||||
verified: false,
|
||||
},
|
||||
})
|
||||
const checkbox = wrapper.find('input[type="checkbox"]')
|
||||
const checkbox = wrapper.find<HTMLInputElement>('input[type="checkbox"]')
|
||||
expect(checkbox.exists()).toBe(true)
|
||||
expect(checkbox.element.checked).toBe(false)
|
||||
})
|
||||
@@ -128,7 +128,7 @@ describe('ObservationRow', () => {
|
||||
verified: true,
|
||||
},
|
||||
})
|
||||
const checkbox = wrapper.find('input[type="checkbox"]')
|
||||
const checkbox = wrapper.find<HTMLInputElement>('input[type="checkbox"]')
|
||||
expect(checkbox.element.checked).toBe(true)
|
||||
})
|
||||
|
||||
|
||||
@@ -71,7 +71,6 @@ function mountWithDraft(batchOverrides: Partial<BatchDetailResponse> = {}) {
|
||||
store.currentDraft = emptyDraft(batch.batchType, {
|
||||
patient: {
|
||||
id: 'dp1',
|
||||
batchId: 'b1',
|
||||
fullName: 'Jane Doe',
|
||||
dateOfBirth: '1990-05-15',
|
||||
sex: 'female',
|
||||
@@ -362,7 +361,6 @@ describe('VerificationForm', () => {
|
||||
store.currentDraft = emptyDraft('ALLERGY_UPDATE', {
|
||||
patient: {
|
||||
id: 'dp1',
|
||||
batchId: 'b1',
|
||||
fullName: 'Jane',
|
||||
dateOfBirth: '1990-01-01',
|
||||
sex: 'female',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { setActivePinia, createPinia } from 'pinia'
|
||||
import { createRouter, createWebHistory, type RouteLocationNormalized } from 'vue-router'
|
||||
import type { RouteLocationNormalized } from 'vue-router'
|
||||
import { useAuthStore, getDefaultRouteForRole } from '@/stores/auth'
|
||||
|
||||
vi.mock('@/api/client', () => ({
|
||||
@@ -26,8 +26,7 @@ function setupGuard() {
|
||||
const nextCalls: (string | undefined)[] = []
|
||||
const auth = useAuthStore()
|
||||
|
||||
function runGuard(to: RouteLocationNormalized, from?: RouteLocationNormalized) {
|
||||
const _from = from ?? buildRoute('/')
|
||||
function runGuard(to: RouteLocationNormalized) {
|
||||
const next = vi.fn((dest?: string) => {
|
||||
nextCalls.push(dest)
|
||||
})
|
||||
|
||||
@@ -81,7 +81,7 @@ describe('useBatchStore', () => {
|
||||
})
|
||||
|
||||
it('sets loading=true during request', async () => {
|
||||
let resolvePromise: (v: unknown) => void
|
||||
let resolvePromise: (v: any) => void
|
||||
mockedGet.mockReturnValueOnce(
|
||||
new Promise((resolve) => {
|
||||
resolvePromise = resolve
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
</label>
|
||||
<div v-if="!patient.noKnownAllergies" class="space-y-2">
|
||||
<div
|
||||
v-for="(allergy, idx) in allergies"
|
||||
v-for="(_allergy, idx) in allergies"
|
||||
:key="idx"
|
||||
class="flex items-center gap-2"
|
||||
>
|
||||
@@ -121,7 +121,7 @@
|
||||
</label>
|
||||
<div v-if="!patient.noActiveMedications" class="space-y-2">
|
||||
<div
|
||||
v-for="(med, idx) in medications"
|
||||
v-for="(_med, idx) in medications"
|
||||
:key="idx"
|
||||
class="flex items-center gap-2"
|
||||
>
|
||||
@@ -324,16 +324,6 @@ const observations = ref<DraftObservation[]>([])
|
||||
|
||||
const statusColor = ref('bg-gray-100 text-gray-800')
|
||||
|
||||
function parseJsonList(json: string | null): string[] {
|
||||
if (!json) return []
|
||||
try {
|
||||
const parsed = JSON.parse(json)
|
||||
return Array.isArray(parsed) ? parsed : []
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
// Load draft data when batch changes
|
||||
watch(
|
||||
() => batchStore.currentDraft,
|
||||
|
||||
@@ -252,16 +252,6 @@ const showAllergies = computed(() => fieldReqs.value?.showAllergies ?? false)
|
||||
const showMedications = computed(() => fieldReqs.value?.showMedications ?? false)
|
||||
const showEncounterSummary = computed(() => fieldReqs.value?.showEncounterSummaryFields ?? false)
|
||||
|
||||
function parseJsonList(json: string | null): string[] {
|
||||
if (!json) return []
|
||||
try {
|
||||
const parsed = JSON.parse(json)
|
||||
return Array.isArray(parsed) ? parsed : []
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => batchStore.currentDraft,
|
||||
(draft) => {
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
"types": ["vite/client"],
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
},
|
||||
|
||||
/* Linting */
|
||||
"noUnusedLocals": true,
|
||||
|
||||
Reference in New Issue
Block a user