Skip to content

Commit

Permalink
🔨 refactor test helper components
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Mar 9, 2018
1 parent df7c98d commit 1b6bc11
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 41 deletions.
13 changes: 2 additions & 11 deletions test/utils/Helper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,9 @@
</template>

<script>
import Promised from '../../src'
import common from './common'
export default {
props: ['promise', 'promises'],
filters: {
text (data) {
return Array.isArray(data) ? data.join(',') : data
},
errorText (data) {
return Array.isArray(data) ? data.map(e => e.message).join(',') : data.message
}
},
components: { Promised },
mixins: [common],
}
</script>
10 changes: 2 additions & 8 deletions test/utils/NoError.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@
</template>

<script>
import Promised from '../../src'
import common from './common'
export default {
props: ['promise', 'promises'],
filters: {
text(data) {
return Array.isArray(data) ? data.join(',') : data
},
},
components: { Promised },
mixins: [common],
}
</script>
13 changes: 2 additions & 11 deletions test/utils/NoPending.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,9 @@
</template>

<script>
import Promised from '../../src'
import common from './common'
export default {
props: ['promise', 'promises'],
filters: {
text(data) {
return Array.isArray(data) ? data.join(',') : data
},
errorText(data) {
return Array.isArray(data) ? data.map(e => e.message).join(',') : data.message
},
},
components: { Promised },
mixins: [common],
}
</script>
13 changes: 2 additions & 11 deletions test/utils/NoResolve.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,9 @@
</template>

<script>
import Promised from '../../src'
import common from './common'
export default {
props: ['promise', 'promises'],
filters: {
text(data) {
return Array.isArray(data) ? data.join(',') : data
},
errorText(data) {
return Array.isArray(data) ? data.map(e => e.message).join(',') : data.message
},
},
components: { Promised },
mixins: [common],
}
</script>
14 changes: 14 additions & 0 deletions test/utils/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Promised from '../../src'

export default {
props: ['promise', 'promises'],
filters: {
text (data) {
return Array.isArray(data) ? data.join(',') : data
},
errorText (data) {
return Array.isArray(data) ? data.map(e => e.message).join(',') : data.message
},
},
components: { Promised },
}

0 comments on commit 1b6bc11

Please sign in to comment.