Skip to content
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

composition test & close buttons for new delegation implementation #1323

Merged
merged 5 commits into from
Sep 24, 2018

Conversation

NodeGuy
Copy link
Contributor

@NodeGuy NodeGuy commented Sep 19, 2018

Make progress against #1219

Description:

Adds a composition test and close buttons to the new Stake modal.

screen shot 2018-09-21 at 1 57 06 pm

@codecov
Copy link

codecov bot commented Sep 19, 2018

Codecov Report

Merging #1323 into develop will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop    #1323   +/-   ##
========================================
  Coverage    89.26%   89.26%           
========================================
  Files           84       84           
  Lines         1733     1733           
  Branches        96       96           
========================================
  Hits          1547     1547           
  Misses         179      179           
  Partials         7        7
Impacted Files Coverage Δ
app/src/renderer/components/staking/ModalStake.vue 100% <ø> (ø) ⬆️

@NodeGuy NodeGuy force-pushed the david/1219-composition-tests branch from 7fb1fc8 to 1d775f8 Compare September 19, 2018 22:59
@NodeGuy NodeGuy force-pushed the david/1219-composition-tests branch from 1d775f8 to e3e1271 Compare September 19, 2018 23:16
@NodeGuy NodeGuy changed the title WIP: composition tests for new delegation implementation composition test & close buttons for new delegation implementation Sep 19, 2018

await submitDelegation({ amount: 10 })

expect($store.dispatch.mock.calls).toEqual([
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use snapshot?

Copy link
Contributor Author

@NodeGuy NodeGuy Sep 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think snapshots are a bad idea because:

  • They're stored in a separate file so you can't see what the test is expecting easily.
  • They require an external tool to manipulate (instead of just your code editor).

simpler = better

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're stored in a separate file so you can't see what the test is expecting easily

true.

They require an external tool to manipulate (instead of just your code editor)

false.

I agree with simpler = better. But it is a lot more comfortable to update snapshots then go through code on a format change and change all the expected values. Let's discuss it.

Copy link
Contributor Author

@NodeGuy NodeGuy Sep 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that snapshots are useful for tracking a format change (e.g., in HTML) as part of Golden Master testing.

The above code is a unit test (not generating HTML), which is a different kind of test. What would be the benefit of using snapshots here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the feeling that having huge json responses in code are too much noise that distract.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good point.

@jbibla
Copy link
Collaborator

jbibla commented Sep 20, 2018

screenshots would be helpful @NodeGuy 📸

@NodeGuy
Copy link
Contributor Author

NodeGuy commented Sep 21, 2018

I added a screenshot.

@faboweb faboweb merged commit 7d15e1c into develop Sep 24, 2018
@faboweb faboweb deleted the david/1219-composition-tests branch September 24, 2018 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants