-
Notifications
You must be signed in to change notification settings - Fork 98
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 #253 from cosmos/peng/179-search-bar-no-results
NiDataEmptySearch created, tests
- Loading branch information
Showing
19 changed files
with
800 additions
and
206 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,15 @@ | ||
<template lang="pug"> | ||
data-msg(icon="search") | ||
div(slot="title") No Results | ||
div(slot="subtitle") Your search did not match any available data. | ||
</template> | ||
|
||
<script> | ||
import DataMsg from 'common/NiDataMsg' | ||
export default { | ||
name: 'ni-data-empty-search', | ||
components: { | ||
DataMsg | ||
} | ||
} | ||
</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
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,29 @@ | ||
import { mount } from 'vue-test-utils' | ||
import htmlBeautify from 'html-beautify' | ||
import NiDataEmpty from 'common/NiDataEmpty' | ||
|
||
describe('NiDataEmpty', () => { | ||
let wrapper | ||
beforeEach(() => { | ||
wrapper = mount(NiDataEmpty) | ||
}) | ||
|
||
it('has the expected html structure', () => { | ||
expect(htmlBeautify(wrapper.html())).toMatchSnapshot() | ||
}) | ||
|
||
it('has an icon', () => { | ||
expect(wrapper.find('.ni-data-msg__icon i.material-icons').text().trim()) | ||
.toBe('info_outline') | ||
}) | ||
|
||
it('has a title', () => { | ||
expect(wrapper.find('.ni-data-msg__title div').text().trim()) | ||
.toBe('N/A') | ||
}) | ||
|
||
it('has a subtitle', () => { | ||
expect(wrapper.find('.ni-data-msg__subtitle div').text().trim()) | ||
.toBe('No data available yet.') | ||
}) | ||
}) |
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,29 @@ | ||
import { mount } from 'vue-test-utils' | ||
import htmlBeautify from 'html-beautify' | ||
import NiDataEmptySearch from 'common/NiDataEmptySearch' | ||
|
||
describe('NiDataEmptySearch', () => { | ||
let wrapper | ||
beforeEach(() => { | ||
wrapper = mount(NiDataEmptySearch) | ||
}) | ||
|
||
it('has the expected html structure', () => { | ||
expect(htmlBeautify(wrapper.html())).toMatchSnapshot() | ||
}) | ||
|
||
it('has an icon', () => { | ||
expect(wrapper.find('.ni-data-msg__icon i.material-icons').text().trim()) | ||
.toBe('search') | ||
}) | ||
|
||
it('has a title', () => { | ||
expect(wrapper.find('.ni-data-msg__title div').text().trim()) | ||
.toBe('No Results') | ||
}) | ||
|
||
it('has a subtitle', () => { | ||
expect(wrapper.find('.ni-data-msg__subtitle div').text().trim()) | ||
.toBe('Your search did not match any available data.') | ||
}) | ||
}) |
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,29 @@ | ||
import { mount } from 'vue-test-utils' | ||
import htmlBeautify from 'html-beautify' | ||
import NiDataEmptyTx from 'common/NiDataEmptyTx' | ||
|
||
describe('NiDataEmptyTx', () => { | ||
let wrapper | ||
beforeEach(() => { | ||
wrapper = mount(NiDataEmptyTx) | ||
}) | ||
|
||
it('has the expected html structure', () => { | ||
expect(htmlBeautify(wrapper.html())).toMatchSnapshot() | ||
}) | ||
|
||
it('has an icon', () => { | ||
expect(wrapper.find('.ni-data-msg__icon i.material-icons').text().trim()) | ||
.toBe('info_outline') | ||
}) | ||
|
||
it('has a title', () => { | ||
expect(wrapper.find('.ni-data-msg__title div').text().trim()) | ||
.toBe('No Transaction History') | ||
}) | ||
|
||
it('has a subtitle', () => { | ||
expect(wrapper.find('.ni-data-msg__subtitle div').text().trim()) | ||
.toContain('Looks like you haven\'t sent or received any transactions yet.') | ||
}) | ||
}) |
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,29 @@ | ||
import { mount } from 'vue-test-utils' | ||
import htmlBeautify from 'html-beautify' | ||
import NiDataError from 'common/NiDataError' | ||
|
||
describe('NiDataError', () => { | ||
let wrapper | ||
beforeEach(() => { | ||
wrapper = mount(NiDataError) | ||
}) | ||
|
||
it('has the expected html structure', () => { | ||
expect(htmlBeautify(wrapper.html())).toMatchSnapshot() | ||
}) | ||
|
||
it('has an icon', () => { | ||
expect(wrapper.find('.ni-data-msg__icon i.material-icons').text().trim()) | ||
.toBe('sentiment_very_dissatisfied') | ||
}) | ||
|
||
it('has a title', () => { | ||
expect(wrapper.find('.ni-data-msg__title div').text().trim()) | ||
.toBe('Aw shucks!') | ||
}) | ||
|
||
it('has a subtitle', () => { | ||
expect(wrapper.find('.ni-data-msg__subtitle div').text().trim()) | ||
.toContain('Even though you\'re connected a full node, we can\'t display this data for you right now.') | ||
}) | ||
}) |
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,21 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`NiDataEmpty has the expected html structure 1`] = ` | ||
"<div class=\\"ni-data-msg\\"> | ||
<div class=\\"ni-data-msg__icon\\"> | ||
<i class=\\"material-icons\\">info_outline</i> | ||
</div> | ||
<div class=\\"ni-data-msg__text\\"> | ||
<div class=\\"ni-data-msg__title\\"> | ||
<div> | ||
N/A | ||
</div> | ||
</div> | ||
<div class=\\"ni-data-msg__subtitle\\"> | ||
<div> | ||
No data available yet. | ||
</div> | ||
</div> | ||
</div> | ||
</div>" | ||
`; |
Oops, something went wrong.