-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
David/1219 new delegation #1355
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
"use strict" | ||
|
||
import htmlBeautify from "html-beautify" | ||
import { mount } from "@vue/test-utils" | ||
import ModalStake from "staking/ModalStake" | ||
|
||
|
@@ -16,6 +17,10 @@ const Wrapper = () => { | |
}) | ||
} | ||
|
||
test(`renders correctly`, () => { | ||
expect(htmlBeautify(Wrapper().html())).toMatchSnapshot() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: wrapper.vm.$el also prints a formated dom representation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, how is that helpful? Is it already beautified? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes in a similar way. |
||
}) | ||
|
||
test(`the "amount" field defaults to 1`, () => { | ||
expect(Wrapper().vm.amount).toEqual(1) | ||
}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders correctly 1`] = ` | ||
"<div id=\\"modal-stake\\" class=\\"modal-stake\\"> | ||
<div class=\\"stake-header\\"> | ||
<img src=\\"~assets/images/cosmos-logo.png\\" class=\\"icon stake-atom\\"><span class=\\"tm-modal-title\\">Stake</span> | ||
<div class=\\"tm-modal-icon tm-modal-close\\"> | ||
<i class=\\"material-icons\\">close</i> | ||
</div> | ||
</div> | ||
<div class=\\"stake-form-group tm-form-group\\"> | ||
<!----> | ||
<label for=\\"to\\" class=\\"tm-form-group__label\\">To</label> | ||
<div class=\\"tm-form-group__field\\"> | ||
<input class=\\"tm-field\\" id=\\"to\\" readonly=\\"readonly\\"> | ||
</div> | ||
</div> | ||
<div class=\\"stake-form-group tm-form-group\\"> | ||
<!----> | ||
<label for=\\"from\\" class=\\"tm-form-group__label\\">From</label> | ||
<div class=\\"tm-form-group__field\\"> | ||
<div class=\\"tm-select\\" id=\\"from\\"> | ||
<select class=\\"tm-field tm-field-select\\"> | ||
<option value=\\"\\" disabled=\\"disabled\\" selected=\\"selected\\" hidden=\\"hidden\\"> | ||
Select option... | ||
</option> | ||
<option value=\\"\\"></option> | ||
</select> | ||
<div class=\\"tm-field-select-addon\\"> | ||
<i class=\\"material-icons\\">arrow_drop_down</i> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class=\\"stake-form-group tm-form-group\\"> | ||
<!----> | ||
<label for=\\"amount\\" class=\\"tm-form-group__label\\">Amount</label> | ||
<div class=\\"tm-form-group__field\\"> | ||
<input type=\\"number\\" max=\\"100\\" min=\\"1\\" class=\\"tm-field\\" id=\\"amount\\"> | ||
</div> | ||
</div> | ||
<div class=\\"stake-footer\\"> | ||
<button class=\\"tm-btn\\"><span class=\\"tm-btn__container tm-btn--size-lg\\"> | ||
<!----> | ||
<!----> | ||
<span class=\\"tm-btn__value\\">Cancel</span></span></button><button class=\\"tm-btn\\"><span class=\\"tm-btn__container tm-btn--size-lg tm-btn--primary\\"> | ||
<!----> | ||
<!----> | ||
<span class=\\"tm-btn__value\\">Stake</span></span></button> | ||
</div> | ||
</div>" | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the feeling an id would be better here. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that's fine. After I see your response to the comment above I can create another PR with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocking concern for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK then I won't bother.