Skip to content

Commit

Permalink
fix: vue components imports inside templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ipetinate committed May 10, 2024
1 parent 983d6aa commit 5d268cf
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/generators/storybook-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export function replaceAllTestTextOccurrences(data) {

data.fileContent = data.fileContent.replace(/resourcePath/g, resourcePath)
}

if (data.framework === FrameworkEnum.react) {
const resourcePath = removePostfixAndExt(data.resourcePathWithFileName)

Expand Down
2 changes: 1 addition & 1 deletion src/templates/storybook/vue/3/js/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ArgTypes, Meta, StoryFn } from '@storybook/vue3'

import { toRefs } from 'vue'

import ResourceName from 'resourcePath'
import ResourceName from 'resourcePath.vue'

const argTypes = {
// Describe your args type (component properties) here to autodocs show properly informations
Expand Down
2 changes: 1 addition & 1 deletion src/templates/storybook/vue/3/ts/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ArgTypes, Args, Meta, StoryFn } from '@storybook/vue3'

import { toRefs } from 'vue'

import ResourceName from 'resourcePath'
import ResourceName from 'resourcePath.vue'

type Props = InstanceType<typeof ResourceName>

Expand Down
2 changes: 1 addition & 1 deletion src/templates/unit-test/vue/js/JestTestingLibrary.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/vue'

import ResourceName from 'resourcePath'
import ResourceName from 'resourcePath.vue'

describe('ResourceName', () => {
const componentData = {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/unit-test/vue/js/JestVanilla.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { shallowMount } from '@vue/test-utils'

import ResourceName from 'resourcePath'
import ResourceName from 'resourcePath.vue'

describe('ResourceName', () => {
const wrapper = shallowMount(ResourceName)
Expand Down
2 changes: 1 addition & 1 deletion src/templates/unit-test/vue/js/VitestTestingLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/vue'

import { describe, it, expect } from 'vitest'

import ResourceName from 'resourcePath'
import ResourceName from 'resourcePath.vue'

describe('ResourceName', () => {
const componentData = {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/unit-test/vue/js/VitestVanilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils'

import { describe, it, expect } from 'vitest'

import ResourceName from 'resourcePath'
import ResourceName from 'resourcePath.vue'

describe('ResourceName', () => {
const wrapper = shallowMount(ResourceName)
Expand Down
2 changes: 1 addition & 1 deletion src/templates/unit-test/vue/ts/Jest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { shallowMount } from '@vue/test-utils'

import ResourceName from 'resourcePath'
import ResourceName from 'resourcePath.vue'

describe('ResourceName', () => {
const wrapper = shallowMount(ResourceName)
Expand Down
2 changes: 1 addition & 1 deletion src/templates/unit-test/vue/ts/JestTestingLibrary.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen, type RenderOptions } from '@testing-library/vue'

import ResourceName from 'resourcePath'
import ResourceName from 'resourcePath.vue'

type RenderComponent = {
props: InstanceType<typeof ResourceName>['$props']
Expand Down
2 changes: 1 addition & 1 deletion src/templates/unit-test/vue/ts/Vitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils'

import { describe, it, expect } from 'vitest'

import ResourceName from 'resourcePath'
import ResourceName from 'resourcePath.vue'

describe('ResourceName', () => {
const wrapper = shallowMount(ResourceName)
Expand Down
2 changes: 1 addition & 1 deletion src/templates/unit-test/vue/ts/VitestTestingLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { render, screen, type RenderOptions } from '@testing-library/vue'

import { describe, it, expect } from 'vitest'

import ResourceName from 'resourcePath'
import ResourceName from 'resourcePath.vue'

type RenderComponent = {
props: InstanceType<typeof ResourceName>['$props']
Expand Down

0 comments on commit 5d268cf

Please sign in to comment.