-
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
Peng/345 eliminate flashing app #393
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<template lang="pug"> | ||
.ni-session: .ni-session-container | ||
.ni-session-header | ||
.ni-session-title Loading… | ||
.ni-session-main | ||
.ni-session-footer | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ni-session-loading' | ||
} | ||
</script> |
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
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ describe('NiSessionWelcome', () => { | |
localVue, | ||
store, | ||
stubs: { | ||
'session-loading': '<session-loading />', | ||
'session-welcome': '<session-welcome />', | ||
'session-sign-up': '<session-sign-up />', | ||
'session-sign-in': '<session-sign-in />', | ||
|
@@ -30,13 +31,20 @@ describe('NiSessionWelcome', () => { | |
}) | ||
}) | ||
|
||
it('should not show by default', () => { | ||
expect(wrapper.isEmpty()).toBe(true) | ||
it('should show by default', () => { | ||
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. it is soooo much easier reading changes if the tests are done right. :) |
||
expect(wrapper.isEmpty()).toBe(false) | ||
}) | ||
|
||
it('should show a welcome screen if activated', () => { | ||
it('should show a loading screen if activated', () => { | ||
store.commit('setModalSession', true) | ||
wrapper.update() | ||
expect(wrapper.contains('session-loading')).toBe(true) | ||
}) | ||
|
||
it('should show a welcome screen if selected', () => { | ||
store.commit('setModalSession', true) | ||
store.commit('setModalSessionState', 'welcome') | ||
wrapper.update() | ||
expect(wrapper.contains('session-welcome')).toBe(true) | ||
}) | ||
|
||
|
15 changes: 15 additions & 0 deletions
15
test/unit/specs/components/common/NISessionLoading.spec.js
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,15 @@ | ||
import { mount } from 'vue-test-utils' | ||
import htmlBeautify from 'html-beautify' | ||
import NiSessionLoading from 'common/NiSessionLoading' | ||
|
||
describe('NiSessionLoading', () => { | ||
let wrapper | ||
|
||
beforeEach(() => { | ||
wrapper = mount(NiSessionLoading) | ||
}) | ||
|
||
it('has the expected html structure', () => { | ||
expect(htmlBeautify(wrapper.html())).toMatchSnapshot() | ||
}) | ||
}) |
19 changes: 19 additions & 0 deletions
19
test/unit/specs/components/common/__snapshots__/NISessionLoading.spec.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,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`NiSessionLoading has the expected html structure 1`] = ` | ||
"<div class=\\"ni-session\\"> | ||
<div class=\\"ni-session-container\\"> | ||
<div class=\\"ni-session-header\\"> | ||
<div class=\\"ni-session-title\\"> | ||
Loading… | ||
</div> | ||
</div> | ||
<div class=\\"ni-session-main\\"> | ||
| ||
</div> | ||
<div class=\\"ni-session-footer\\"> | ||
| ||
</div> | ||
</div> | ||
</div>" | ||
`; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Cool! I like the switching of components in the container more then in the component itself. This makes it better composable.