Skip to content

Commit be7a3b8

Browse files
test(unit): make test for loop validation names components
1 parent 568b4a0 commit be7a3b8

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { describe, it, expect } from 'vitest'
2+
3+
import { mount } from '@vue/test-utils'
4+
import VueTechsLogos from '../VueTechsLogos.vue'
5+
import { techs } from './mock'
6+
7+
describe('VueTechsLogos', () => {
8+
it('renders properly', () => {
9+
const wrapper = mount(VueTechsLogos, { props: { name: 'vue', label: 'Test Vue' } })
10+
expect(wrapper.text()).toContain('Vue')
11+
expect(wrapper.text()).toContain('Test Vue')
12+
})
13+
it('renders properly', () => {
14+
const wrapper = mount(VueTechsLogos)
15+
16+
for(let item of techs) {
17+
expect(wrapper.text()).toContain(item.name)
18+
}
19+
})
20+
})

src/components/__tests__/mock.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
export const techs = [
2+
{ name: 'Android', url: 'https://www.android.com' },
3+
{ name: 'Apple', url: 'https://www.apple.com' },
4+
{ name: 'Linux', url: 'https://ubuntu.com' },
5+
{ name: 'Microsoft', url: 'https://www.microsoft.com' },
6+
{ name: 'PlayStore', url: 'https://play.google.com' },
7+
{ name: 'PWA', url: 'https://web.dev/progressive-web-apps' },
8+
{ name: 'HTML', url: 'https://developer.mozilla.org/en-US/docs/Glossary/HTML5' },
9+
{ name: 'CSS', url: 'https://developer.mozilla.org/en-US/docs/Glossary/CSS' },
10+
{ name: 'JavaScript', url: 'https://developer.mozilla.org/en-US/docs/Glossary/Javascript' },
11+
{ name: 'Typescript', url: 'https://www.typescriptlang.org/docs' },
12+
{ name: 'Node', url: 'https://nodejs.org/en' },
13+
{ name: 'Java', url: 'https://www.java.com' },
14+
{ name: 'Ruby', url: 'https://www.ruby-lang.org/en' },
15+
{ name: 'Python', url: 'https://docs.python.org' },
16+
{ name: 'Swift', url: 'https://developer.apple.com/swift' },
17+
{ name: 'PHP', url: 'https://www.php.net' },
18+
{ name: 'C#', url: 'https://learn.microsoft.com/en-us/dotnet/csharp' },
19+
{ name: 'C++', url: 'https://learn.microsoft.com/en-us/dotnet/csharp' },
20+
{ name: 'VisualCode', url: 'https://code.visualstudio.com' },
21+
{ name: 'Github', url: 'https://github.com/criar-art' },
22+
{ name: 'NPM', url: 'npmjs.com/package/vue-techs-logos' },
23+
{ name: 'YouTube', url: 'https://youtube.com' },
24+
{ name: 'Wordpress', url: 'https://wordpress.com' },
25+
{ name: 'Tumblr', url: 'https://www.tumblr.com' },
26+
{ name: 'CodePen', url: 'https://codepen.io' },
27+
{ name: 'Vue', url: 'https://vuejs.org' },
28+
{ name: 'React', url: 'https://reactjs.org' },
29+
{ name: 'Angular', url: 'https://angular.io' },
30+
{ name: 'Svelte', url: 'https://svelte.dev' },
31+
{ name: 'Ember', url: 'https://emberjs.com' },
32+
{ name: 'Stylus', url: 'https://stylus-lang.com' },
33+
{ name: 'Tailwind', url: 'https://tailwindcss.com' },
34+
{ name: 'Less', url: 'https://lesscss.org' },
35+
{ name: 'Sass', url: 'https://sass-lang.com' },
36+
{ name: 'Webpack', url: 'https://webpack.js.org' },
37+
{ name: 'Vite', url: 'https://vitejs.dev' },
38+
{ name: 'Gulp', url: 'https://gulpjs.com' },
39+
{ name: 'Jest', url: 'https://jestjs.io/pt-BR' },
40+
{ name: 'Karma', url: 'https://karma-runner.github.io' },
41+
{ name: 'Vitest', url: 'https://vitest.dev' },
42+
{ name: 'Xcode', url: 'https://developer.apple.com/xcode' },
43+
{ name: 'Whatsapp', url: 'https://web.whatsapp.com' },
44+
{ name: 'Telegram', url: 'https://web.telegram.org' },
45+
{ name: 'Cypress', url: 'https://www.cypress.io' },
46+
{ name: 'Mozilla', url: 'https://www.mozilla.org' },
47+
{ name: 'Safari', url: 'https://www.apple.com/br/safari' },
48+
{ name: 'Edge', url: 'https://www.microsoft.com/pt-br/edge' },
49+
{ name: 'Chrome', url: 'https://www.google.com/intl/pt-BR/chrome' },
50+
{ name: 'MySQL', url: 'https://www.mysql.com' },
51+
{ name: 'Firebase', url: 'https://firebase.google.com' },
52+
{ name: 'Git', url: 'https://git-scm.com' }
53+
];

0 commit comments

Comments
 (0)