Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/tests/components/ContactForm.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import type { VueWrapper } from "@vue/test-utils"
import type { H3Event } from "h3"

import { ContactForm } from "#components"
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
import { flushPromises } from "@vue/test-utils"
import { readBody } from "h3"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import ContactForm from "~/components/ContactForm.vue"

describe("Компонент ContactForm", () => {
let wrapper: VueWrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { VueWrapper } from "@vue/test-utils"

import { UButton } from "#components"
import { shallowMount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import Social from "~/components/Social.server.vue"

Expand Down
1 change: 0 additions & 1 deletion app/tests/components/TheFooter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import type { VueWrapper } from "@vue/test-utils"

import { shallowMount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import TheFooter from "~/components/TheFooter.server.vue"

Expand Down
15 changes: 7 additions & 8 deletions app/tests/components/about-me/AboutMeIcon.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
// @vitest-environment happy-dom
import type { VueWrapper } from "@vue/test-utils"

import { AboutMeIcon } from "#components"
import { shallowMount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import type { TechnologyIcon } from "~/components/about-me/AboutMeIcon.vue"

import AboutMeIcon from "~/components/about-me/AboutMeIcon.vue"
const icon = {
color: "#00DC82",
icon: "logos:nuxt-icon",
key: "nuxt",
title: "Nuxt 3",
} as const satisfies TechnologyIcon

describe("Компонент AboutMeIcon", () => {
const icon = {
color: "#00DC82",
icon: "logos:nuxt-icon",
key: "nuxt",
title: "Nuxt 3",
} as const satisfies TechnologyIcon
let wrapper: VueWrapper

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import type { VueWrapper } from "@vue/test-utils"
import type { H3Event } from "h3"

import { PersonalProjects, PersonalProjectsCard } from "#components"
import { getHeaderLocale } from "@intlify/h3"
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
import { getQuery } from "h3"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import PersonalProjects from "~/components/personal-projects/PersonalProjects.vue"
import PersonalProjectsCard from "~/components/personal-projects/PersonalProjectsCard.vue"
import { personalProjects } from "~/tests/constants/personalProjects"
import personalProjects from "~/tests/constants/personalProjects"

describe("Компонент PersonalProjects", () => {
let wrapper: VueWrapper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// @vitest-environment happy-dom
import type { VueWrapper } from "@vue/test-utils"

import { LazyUButton, UBadge } from "#components"
import {
LazyUButton,
PersonalProjectsCard,
UBadge,
UiCardContent,
} from "#components"
import { shallowMount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import PersonalProjectsCard from "~/components/personal-projects/PersonalProjectsCard.vue"
import UiCardContent from "~/components/ui/UiCardContent.vue"
import { personalProjects } from "~/tests/constants/personalProjects"
import personalProjects from "~/tests/constants/personalProjects"

describe("Компонент PersonalProjectsCard", () => {
const personalProject = personalProjects[0]
Expand Down
6 changes: 2 additions & 4 deletions app/tests/components/projects/Projects.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import type { VueWrapper } from "@vue/test-utils"
import type { H3Event } from "h3"

import { Projects, ProjectsCard } from "#components"
import { getHeaderLocale } from "@intlify/h3"
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
import { getQuery } from "h3"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import Projects from "~/components/projects/Projects.vue"
import ProjectsCard from "~/components/projects/ProjectsCard.vue"
import { projects } from "~/tests/constants/projects"
import projects from "~/tests/constants/projects"

describe("Компонент Projects", () => {
let wrapper: VueWrapper
Expand Down
6 changes: 2 additions & 4 deletions app/tests/components/projects/ProjectsCard.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// @vitest-environment happy-dom
import type { VueWrapper } from "@vue/test-utils"

import { ProjectsCard, UiCardContent } from "#components"
import { shallowMount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import ProjectsCard from "~/components/projects/ProjectsCard.vue"
import UiCardContent from "~/components/ui/UiCardContent.vue"
import { projects } from "~/tests/constants/projects"
import projects from "~/tests/constants/projects"

describe("Компонент ProjectsCard", () => {
const project = projects[0]
Expand Down
4 changes: 1 addition & 3 deletions app/tests/components/the-header/TheHeader.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { VueWrapper } from "@vue/test-utils"

import { TheHeader } from "#components"
import { mountSuspended } from "@nuxt/test-utils/runtime"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import TheHeader from "~/components/the-header/TheHeader.vue"

describe("Компонент TheHeader", () => {
let wrapper: VueWrapper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import type { VueWrapper } from "@vue/test-utils"

import { UButton } from "#components"
import { TheHeaderNavigationMobile, UButton } from "#components"
import { mountSuspended } from "@nuxt/test-utils/runtime"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import TheHeaderNavigationMobile from "~/components/the-header/TheHeaderNavigationMobile.vue"
import { navigation } from "~/tests/constants/navigation"
import navigation from "~/tests/constants/navigation"

describe("Компонент TheHeaderNavigationMobile", () => {
let wrapper: VueWrapper
Expand Down
3 changes: 1 addition & 2 deletions app/tests/components/ui/UiBlock.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// @vitest-environment happy-dom
import type { VueWrapper } from "@vue/test-utils"

import { UiBlock } from "#components"
import { shallowMount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import UiBlock from "~/components/ui/UiBlock.vue"
import { TEST_BLOCK } from "~/tests/constants/utils"

describe("Компонент UiBlock", () => {
Expand Down
5 changes: 2 additions & 3 deletions app/tests/components/ui/UiCardContent.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// @vitest-environment happy-dom
import type { VueWrapper } from "@vue/test-utils"

import { UiCardContent } from "#components"
import { shallowMount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import UiCardContent from "~/components/ui/UiCardContent.vue"
import { tags } from "~/tests/constants/tags"
import tags from "~/tests/constants/tags"

describe("Компонент UiCardContent", () => {
const cardContent = {
Expand Down
4 changes: 1 addition & 3 deletions app/tests/components/ui/UiContactMeButton.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { VueWrapper } from "@vue/test-utils"

import { UiContactMeButton } from "#components"
import { mountSuspended } from "@nuxt/test-utils/runtime"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import UiContactMeButton from "~/components/ui/UiContactMeButton.vue"

describe("Компонент UiContactMeButton", () => {
let wrapper: VueWrapper
Expand Down
4 changes: 1 addition & 3 deletions app/tests/components/ui/UiHero.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// @vitest-environment happy-dom
import type { VueWrapper } from "@vue/test-utils"

import { UiHero } from "#components"
import { mount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import UiHero from "~/components/ui/UiHero.vue"

describe("Компонент UiHero", () => {
let wrapper: VueWrapper
Expand Down
5 changes: 1 addition & 4 deletions app/tests/components/ui/UiShowAllButton.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import type { VueWrapper } from "@vue/test-utils"

import { UButton } from "#components"
import { UButton, UiShowAllButton } from "#components"
import { shallowMount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import UiShowAllButton from "~/components/ui/UiShowAllButton.vue"

describe("UiShowAllButton", () => {
let wrapper: VueWrapper
Expand Down
6 changes: 2 additions & 4 deletions app/tests/components/ui/UiTags.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// @vitest-environment happy-dom
import type { VueWrapper } from "@vue/test-utils"

import { UBadge } from "#components"
import { UBadge, UiTags } from "#components"
import { shallowMount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import UiTags from "~/components/ui/UiTags.vue"
import { tags } from "~/tests/constants/tags"
import tags from "~/tests/constants/tags"

describe("Компонент UiTags", () => {
let wrapper: VueWrapper
Expand Down
6 changes: 2 additions & 4 deletions app/tests/components/workplaces/Workplaces.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import type { VueWrapper } from "@vue/test-utils"
import type { H3Event } from "h3"

import { Workplaces, WorkplacesCard } from "#components"
import { getHeaderLocale } from "@intlify/h3"
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import WorkplacesCard from "~/components/workplaces/card/WorkplacesCard.vue"
import Workplaces from "~/components/workplaces/Workplaces.vue"
import { workplaces } from "~/tests/constants/workplaces"
import workplaces from "~/tests/constants/workplaces"

describe("Компонент Workplaces", () => {
let wrapper: VueWrapper
Expand Down
6 changes: 2 additions & 4 deletions app/tests/components/workplaces/card/WorkplacesCard.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// @vitest-environment happy-dom
import type { VueWrapper } from "@vue/test-utils"

import { UiCardContent, WorkplacesCard } from "#components"
import { shallowMount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import UiCardContent from "~/components/ui/UiCardContent.vue"
import WorkplacesCard from "~/components/workplaces/card/WorkplacesCard.vue"
import { workplaces } from "~/tests/constants/workplaces"
import workplaces from "~/tests/constants/workplaces"

describe("Компонент WorkplacesCard", () => {
const workplace = workplaces[0]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import type { VueWrapper } from "@vue/test-utils"

import { UBadge } from "#components"
import { UBadge, WorkplacesCardDate } from "#components"
import { mountSuspended } from "@nuxt/test-utils/runtime"
import { afterEach, beforeEach, describe, expect, test } from "vitest"

import WorkplacesCardDate from "~/components/workplaces/card/WorkplacesCardDate.vue"

describe("Компонент WorkplacesCardDate", () => {
const date = "2024-01-01T00:00:00.000Z"
Expand Down
4 changes: 1 addition & 3 deletions app/tests/composables/useFirstInputFocus.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// @vitest-environment happy-dom
import type { VueWrapper } from "@vue/test-utils"

import { useFirstInputFocus } from "#imports"
import { shallowMount } from "@vue/test-utils"
import { afterEach, describe, expect, test } from "vitest"

import useFirstInputFocus from "~/composables/useFirstInputFocus"

describe("Функция useFirstInputFocus", () => {
const testingComponent = defineComponent({
Expand Down
2 changes: 1 addition & 1 deletion app/tests/constants/navigation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NavigationMenuItem } from "@nuxt/ui"

export const navigation = [
export default [
{ icon: "heroicons:home", label: "Home", to: "/" },
{ icon: "heroicons:briefcase", label: "Experience", to: "/experience" },
] as const satisfies NavigationMenuItem[]
4 changes: 2 additions & 2 deletions app/tests/constants/personalProjects.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { tags } from "./tags"
import tags from "./tags"

export const personalProjects = [
export default [
{
description: "Описание личного проекта",
github: "https://exer7um.com/",
Expand Down
4 changes: 2 additions & 2 deletions app/tests/constants/projects.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { tags } from "~/tests/constants/tags"
import tags from "~/tests/constants/tags"

export const projects = [
export default [
{
backgroundColor: "#000000",
description: "Интернет-магазин брендовой одежды",
Expand Down
2 changes: 1 addition & 1 deletion app/tests/constants/tags.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Tag } from "~~/server/database/schema/tag"

export const tags = [
export default [
{ id: 1, title: "Заголовок тега" },
{ id: 2, title: "Заголовок тега" },
] as const satisfies Tag[]
4 changes: 2 additions & 2 deletions app/tests/constants/workplaces.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { tags } from "~/tests/constants/tags"
import tags from "~/tests/constants/tags"

export const workplaces = [
export default [
{
description: "Описание места работы",
endDate: "2024-08-01T00:00:00.000Z",
Expand Down
Loading