-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from Qvant-lab/qinputnumber_fix
[QInputNumber] fix null value, fix "-" value, add placeholder
- Loading branch information
Showing
4 changed files
with
152 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Component from './src/QInputNumber'; | ||
|
||
describe('QInputNumber', () => { | ||
it('should match snapshot', () => { | ||
const { element } = shallowMount(Component); | ||
|
||
expect(element).toMatchSnapshot(); | ||
}); | ||
|
||
it('should match snapshot without controls', () => { | ||
const { element } = shallowMount(Component, { | ||
propsData: { | ||
controls: false | ||
} | ||
}); | ||
|
||
expect(element).toMatchSnapshot(); | ||
}); | ||
|
||
it('data should match snapshot', () => { | ||
expect(Component.data()).toMatchSnapshot(); | ||
}); | ||
}); |
53 changes: 53 additions & 0 deletions
53
src/qComponents/QInputNumber/__snapshots__/QInputNumber.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`QInputNumber data should match snapshot 1`] = ` | ||
Object { | ||
"number": null, | ||
"prevNumber": null, | ||
"userNumber": null, | ||
} | ||
`; | ||
|
||
exports[`QInputNumber should match snapshot 1`] = ` | ||
<div | ||
class="q-input-number q-input-number_with-controls" | ||
> | ||
<button | ||
class="q-input-number__button_decrease q-input-number__button q-icon-minus" | ||
/> | ||
<q-input-stub | ||
autocomplete="off" | ||
class="q-input-number__input" | ||
label="" | ||
suffixicon="" | ||
tabindex="" | ||
type="number" | ||
value="" | ||
/> | ||
<button | ||
class="q-input-number__button_increase q-input-number__button q-icon-plus" | ||
/> | ||
</div> | ||
`; | ||
|
||
exports[`QInputNumber should match snapshot without controls 1`] = ` | ||
<div | ||
class="q-input-number" | ||
> | ||
<!----> | ||
<q-input-stub | ||
autocomplete="off" | ||
class="q-input-number__input" | ||
label="" | ||
suffixicon="" | ||
tabindex="" | ||
type="number" | ||
value="" | ||
/> | ||
<!----> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters