remove fixture for task and steps

This commit is contained in:
Julien Calixte
2023-04-15 13:58:43 +02:00
parent 5bf3d248dd
commit 75d3c0f718
3 changed files with 1565 additions and 14 deletions

View File

@@ -6,7 +6,7 @@
"dev": "vite", "dev": "vite",
"build": "run-p type-check build-only", "build": "run-p type-check build-only",
"preview": "vite preview", "preview": "vite preview",
"test": "pnpm lint && pnpm type-check && pnpm test:unit", "test": "pnpm lint && pnpm type-check && pnpm test:unit --ui",
"test:unit": "vitest", "test:unit": "vitest",
"build-only": "vite build", "build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
@@ -29,6 +29,8 @@
"@types/jsdom": "^21.1.1", "@types/jsdom": "^21.1.1",
"@types/node": "^18.14.2", "@types/node": "^18.14.2",
"@vitejs/plugin-vue": "^4.1.0", "@vitejs/plugin-vue": "^4.1.0",
"@vitest/browser": "^0.30.1",
"@vitest/ui": "^0.30.1",
"@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-prettier": "^7.1.0",
"@vue/eslint-config-typescript": "^11.0.2", "@vue/eslint-config-typescript": "^11.0.2",
"@vue/test-utils": "^2.3.2", "@vue/test-utils": "^2.3.2",
@@ -42,6 +44,7 @@
"typescript": "~4.8.4", "typescript": "~4.8.4",
"vite": "^4.2.1", "vite": "^4.2.1",
"vitest": "^0.29.8", "vitest": "^0.29.8",
"vue-tsc": "^1.2.0" "vue-tsc": "^1.2.0",
"webdriverio": "^8.8.2"
} }
} }

1557
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { createUuid } from '@/shared/create-uuid' import { createUuid } from '@/shared/create-uuid'
import { faker } from '@faker-js/faker'
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { createStepFixture } from '../models/step.fixture' import type { Stepable } from '../interfaces/stepable'
import { Task } from '../models/task' import { Task } from '../models/task'
import { useTaskStore } from '../stores/useTask.store' import { useTaskStore } from '../stores/useTask.store'
import StepInput from './StepInput.vue' import StepInput from './StepInput.vue'
@@ -13,13 +12,11 @@ const router = useRouter()
const id = createUuid() const id = createUuid()
const title = ref(faker.animal.bird()) const title = ref('')
const link = ref(faker.internet.url()) const link = ref('')
const steps = ref(
Array.from({ length: Math.floor(Math.random() * 10) }, () => const steps = ref<Stepable[]>([])
createStepFixture()
)
)
const totalEstimation = computed(() => const totalEstimation = computed(() =>
steps.value.map((step) => step.estimation).reduce((a, b) => a + b, 0) steps.value.map((step) => step.estimation).reduce((a, b) => a + b, 0)
) )