Skip to content

Commit

Permalink
Merge pull request #170 from philippebeck/dev
Browse files Browse the repository at this point in the history
Release 3.0.2-alpha
  • Loading branch information
philippebeck authored Mar 10, 2024
2 parents 1678528 + 1336d4a commit 4398cc7
Show file tree
Hide file tree
Showing 56 changed files with 382 additions and 343 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# vesan

Vesan is a Frontend Framework made with Vue 3, TypeScript, Vuex, Axios, Sass & Animadio
Includes Font-Awesome, Recaptcha, PayPal, TinyMCE, Vitest & Cypress
Vesan is a Frontend Framework made with Vue 3, TypeScript & Animadio
Includes Axios, Font-Awesome, Recaptcha, PayPal, Sass, TinyMCE, Vitest & Cypress

Migration from Option API to Composition API in progress (~ 30%)
Migration of all scripts from JS to TS in progress (~ 60%)
Migration of the tests from Jest to Vitest in progress too (~ 60%)
**WARNING**: build is not ready yet on the version 3 *(alpha mode)*
*For production ready*: use the last version 2

Migration from Option API to Composition API in progress (~ 40%)
Migration of all scripts from JS to TS in progress (~ 80%)
Migration of the tests from Jest to Vitest in progress too (~ 70%)

Migration of the store from Vuex to Pinia soon
Added e2e tests with Cypress soon too
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vesan",
"version": "3.0.1-alpha",
"version": "3.0.2-alpha",
"description": "Frontend Framework with Vue, TypeScript, Vuex, Axios, Sass & Animadio",
"type": "module",
"keywords": [
Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/App.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const router = createRouter({
]
})

let wrapper
let store
let actions
let state
let wrapper: any
let store: any
let actions: any
let state: any

/**
* @vi-environment jsdom
Expand All @@ -44,7 +44,7 @@ beforeEach(() => {
})

wrapper = shallowMount(App, {
data() {
data(): any {
return {
values: values
}
Expand Down
20 changes: 5 additions & 15 deletions src/__tests__/assets/services.spe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,31 +571,21 @@ describe('setMeta()', () => {
setMeta('New Title', 'Description', 'https://example.com')

expect(document.querySelector('title').innerText).toEqual('New Title')
expect(document.querySelector('[property="og:title"]').getAttribute('content')).toEqual(
'New Title'
)
expect(document.querySelector('[property="og:title"]').getAttribute('content')).toEqual('New Title')
})

test('should set the description correctly', () => {
setMeta('Title', 'New Description', 'https://example.com')

expect(document.querySelector('[name="description"]').getAttribute('content')).toEqual(
'New Description'
)
expect(document.querySelector('[property="og:description"]').getAttribute('content')).toEqual(
'New Description'
)
expect(document.querySelector('[name="description"]').getAttribute('content')).toEqual('New Description')
expect(document.querySelector('[property="og:description"]').getAttribute('content')).toEqual('New Description')
})

test('should set the url correctly', () => {
setMeta('Title', 'Description', 'https://example.com/new-url')

expect(document.querySelector('[property="og:url"]').getAttribute('content')).toEqual(
'https://example.com/new-url'
)
expect(document.querySelector('[rel="canonical"]').getAttribute('href')).toEqual(
'https://example.com/new-url'
)
expect(document.querySelector('[property="og:url"]').getAttribute('content')).toEqual('https://example.com/new-url')
expect(document.querySelector('[rel="canonical"]').getAttribute('href')).toEqual('https://example.com/new-url')
})

test('should set the image correctly', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/ArticleSet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
import { shallowMount, enableAutoUnmount } from '@vue/test-utils'
import ArticleSet from '../../components/ArticleSet.vue'

let wrapper
let wrapper: any

vi.mock('axios')

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/BtnElt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'vitest'
import { mount, enableAutoUnmount } from '@vue/test-utils'
import BtnElt from '../../components/BtnElt.vue'

let wrapper
let wrapper: any

enableAutoUnmount(afterEach)

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/CardElt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'vitest'
import { enableAutoUnmount, mount } from '@vue/test-utils'
import CardElt from '../../components/CardElt.vue'

let wrapper
let wrapper: any

enableAutoUnmount(afterEach)

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/FieldElt.spe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'vitest'
import { mount, enableAutoUnmount } from '@vue/test-utils'
import FieldElt from '../../components/FieldElt.vue'

let wrapper
let wrapper: any

enableAutoUnmount(afterEach)

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/FootElt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'vitest'
import { enableAutoUnmount, mount } from '@vue/test-utils'
import FootElt from '../../components/FootElt.vue'

let wrapper
let wrapper: any

enableAutoUnmount(afterEach)

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/GallerySet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
import { shallowMount, enableAutoUnmount } from '@vue/test-utils'
import GallerySet from '../../components/GallerySet.vue'

let wrapper
let wrapper: any

vi.mock('axios')

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/ImageSet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
import { shallowMount, enableAutoUnmount } from '@vue/test-utils'
import ImageSet from '../../components/ImageSet.vue'

let wrapper
let wrapper: any

vi.mock('axios')

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/LinkSet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { shallowMount, enableAutoUnmount } from '@vue/test-utils'
import * as services from '../../assets/services'
import LinkSet from '../../components/LinkSet.vue'

let wrapper
let wrapper: any

vi.mock('axios')

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/ListElt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'vitest'
import { enableAutoUnmount, mount } from '@vue/test-utils'
import ListElt from '../../components/ListElt.vue'

let wrapper
let wrapper: any

enableAutoUnmount(afterEach)

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/MediaElt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'vitest'
import { enableAutoUnmount, mount } from '@vue/test-utils'
import MediaElt from '../../components/MediaElt.vue'

let wrapper
let wrapper: any

enableAutoUnmount(afterEach)

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/NavElt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'vitest'
import { enableAutoUnmount, mount } from '@vue/test-utils'
import NavElt from '../../components/NavElt.vue'

let wrapper
let wrapper: any

enableAutoUnmount(afterEach)

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/OrderSet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
import { shallowMount, enableAutoUnmount } from '@vue/test-utils'
import OrderSet from '../../components/OrderSet.vue'

let wrapper
let wrapper: any

vi.mock('axios')

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/ProductSet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
import { shallowMount, enableAutoUnmount } from '@vue/test-utils'
import ProductSet from '../../components/ProductSet.vue'

let wrapper
let wrapper: any

vi.mock('axios')

Expand Down
16 changes: 3 additions & 13 deletions src/__tests__/components/SliderElt.spe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
import { mount, enableAutoUnmount } from '@vue/test-utils'
import SliderElt from '../../components/SliderElt.vue'

let wrapper
let wrapper: any

beforeEach(() => {
wrapper = mount(SliderElt, {
Expand Down Expand Up @@ -262,23 +262,13 @@ describe('checkRandom() method', () => {
test("must call setRandom(false, 'Random', 'fa-random', 'fa-long-arrow-alt-right') method if randomState is true", () => {
wrapper.vm.randomState = true
wrapper.vm.checkRandom()
expect(wrapper.vm.setRandom).toHaveBeenCalledWith(
false,
'Random',
'fa-random',
'fa-long-arrow-alt-right'
)
expect(wrapper.vm.setRandom).toHaveBeenCalledWith(false, 'Random', 'fa-random', 'fa-long-arrow-alt-right')
})

test("must call setRandom(true, 'Normal', 'fa-long-arrow-alt-right', 'fa-random') method if randomState is false", () => {
wrapper.vm.randomState = false
wrapper.vm.checkRandom()
expect(wrapper.vm.setRandom).toHaveBeenCalledWith(
true,
'Normal',
'fa-long-arrow-alt-right',
'fa-random'
)
expect(wrapper.vm.setRandom).toHaveBeenCalledWith(true, 'Normal', 'fa-long-arrow-alt-right', 'fa-random')
})

test('must call refreshSlide() method', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/TableElt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'vitest'
import { enableAutoUnmount, mount } from '@vue/test-utils'
import TableElt from '../../components/TableElt.vue'

let wrapper
let wrapper: any

enableAutoUnmount(afterEach)

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/UserSet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
import { shallowMount, enableAutoUnmount } from '@vue/test-utils'
import UserSet from '../../components/UserSet.vue'

let wrapper
let wrapper: any

vi.mock('axios')

Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/views/ArticleView.spe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ const user = {
role: role
}

let wrapper
let store
let actions
let state
let wrapper: any
let store: any
let actions: any
let state: any

/**
* @vi-environment jsdom
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/views/BasketView.spe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ global.fetch = vi.fn(() =>
})
)

let wrapper
let wrapper: any

beforeEach(() => {
vi.spyOn(services, 'setMeta').mockImplementation(() => {})
Expand All @@ -32,7 +32,7 @@ beforeEach(() => {
email: '[email protected]'
}
},
data() {
data(): any {
return {
basket: [
{
Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/views/BlogView.spe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { createStore } from 'vuex'
import * as services from '../../assets/services'
import BlogView from '../../views/BlogView.vue'

let wrapper
let store
let actions
let state
let wrapper: any
let store: any
let actions: any
let state: any

beforeEach(() => {
vi.spyOn(services, 'setMeta').mockImplementation(() => {})
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/views/ContactView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { shallowMount, enableAutoUnmount } from '@vue/test-utils'
import * as services from '../../assets/services'
import ContactView from '../../views/ContactView.vue'

let wrapper
let wrapper: any

/**
* @vi-environment jsdom
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/views/ErrorView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'vitest'
import { shallowMount, enableAutoUnmount } from '@vue/test-utils'
import ErrorView from '../../views/ErrorView.vue'

let wrapper
let wrapper: any

beforeEach(() => {
wrapper = shallowMount(ErrorView, {
Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/views/GalleryView.spe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { createStore } from 'vuex'
import * as services from '../../assets/services'
import GalleryView from '../../views/GalleryView.vue'

let wrapper
let store
let actions
let state
let wrapper: any
let store: any
let actions: any
let state: any

/**
* @vi-environment jsdom
Expand Down Expand Up @@ -66,7 +66,7 @@ describe('GalleryView', () => {
})

test('wrapper created hook', () => {
expect(serve.setMeta).toHaveBeenCalled()
expect(services.setMeta).toHaveBeenCalled()
expect(actions.listGalleries).toHaveBeenCalled()
})

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/views/HomeView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { shallowMount, enableAutoUnmount } from '@vue/test-utils'
import * as services from '../../assets/services'
import HomeView from '../../views/HomeView.vue'

let wrapper
let wrapper: any

/**
* @vi-environment jsdom
Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/views/ImageView.spe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ const mockRouter = {
push: vi.fn()
}

let wrapper
let store
let actions
let state
let wrapper: any
let store: any
let actions: any
let state: any

beforeEach(() => {
vi.spyOn(services, 'setMeta').mockImplementation(() => {})
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/views/LegalView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { shallowMount, enableAutoUnmount } from '@vue/test-utils'
import * as services from '../../assets/services'
import LegalView from '../../views/LegalView.vue'

let wrapper
let wrapper: any

beforeEach(() => {
vi.spyOn(services, 'setMeta').mockImplementation(() => {})
Expand Down
Loading

0 comments on commit 4398cc7

Please sign in to comment.