mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Write firs component test, add search placeholder translation
This commit is contained in:
parent
f09d3ed685
commit
b032887430
30
components/SearchInput.spec.js
Normal file
30
components/SearchInput.spec.js
Normal file
@ -0,0 +1,30 @@
|
||||
import { shallowMount, mount } from '@vue/test-utils'
|
||||
import SearchInput from './SearchInput.vue'
|
||||
|
||||
describe('SearchInput.vue', () => {
|
||||
let wrapper
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallowMount(SearchInput, {})
|
||||
})
|
||||
|
||||
it('renders', () => {
|
||||
expect(wrapper.is('div')).toBe(true)
|
||||
})
|
||||
|
||||
it('has id "nav-search"', () => {
|
||||
expect(wrapper.contains('#nav-search')).toBe(true)
|
||||
})
|
||||
|
||||
it('defaults to an empty value', () => {
|
||||
wrapper = mount(SearchInput, {
|
||||
propsData: {
|
||||
value: null
|
||||
}
|
||||
})
|
||||
expect(wrapper.text()).toBe('')
|
||||
})
|
||||
|
||||
// TODO: add similar software tests for other components
|
||||
// TODO: add more test cases in this file
|
||||
})
|
||||
@ -176,4 +176,14 @@ export default {
|
||||
color: hsl(0, 0%, 71%);
|
||||
}
|
||||
}
|
||||
|
||||
.input,
|
||||
.has-icons-left,
|
||||
.has-icons-right {
|
||||
.icon,
|
||||
i {
|
||||
// color: lighten($grey-light, 15%);
|
||||
transition: color 150ms ease-out !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -168,5 +168,8 @@
|
||||
"name": "Name",
|
||||
"loadMore": "load more",
|
||||
"loading": "loading"
|
||||
},
|
||||
"search": {
|
||||
"placeholder": "Search..."
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user