Expand content policy alert

This commit is contained in:
Pig Fang 2019-05-01 20:15:41 +08:00
parent 9d2990389d
commit fb10962ff9
2 changed files with 5 additions and 14 deletions

View File

@ -47,9 +47,8 @@
</el-button> </el-button>
</div> </div>
<a v-if="contentPolicy" href="#" @click="showContentPolicy"> <!-- eslint-disable-next-line vue/no-v-html -->
{{ $t('skinlib.showContentPolicy') }} <div v-if="contentPolicy" class="callout callout-warning" v-html="contentPolicy" />
</a>
</div> </div>
<div class="box-footer"> <div class="box-footer">
@ -191,11 +190,6 @@ export default {
this.$refs.upload.clear() this.$refs.upload.clear()
this.texture = '' this.texture = ''
}, },
showContentPolicy() {
this.$alert(this.contentPolicy, {
dangerouslyUseHTMLString: true,
})
},
}, },
} }
</script> </script>

View File

@ -46,9 +46,9 @@ test('notice should be display if texture is private', () => {
const wrapper = mount(Upload, { const wrapper = mount(Upload, {
stubs: ['file-upload'], stubs: ['file-upload'],
}) })
expect(wrapper.contains('.callout')).toBeFalse() expect(wrapper.contains('.callout-info')).toBeFalse()
wrapper.find('[type=checkbox]').setChecked() wrapper.find('[type=checkbox]').setChecked()
expect(wrapper.find('.callout').text()).toBe('privacyNotice') expect(wrapper.find('.callout-info').text()).toBe('privacyNotice')
}) })
test('display score cost', () => { test('display score cost', () => {
@ -171,8 +171,5 @@ test('show notice about awarding', () => {
test('show content policy', () => { test('show content policy', () => {
const wrapper = mount(Upload) const wrapper = mount(Upload)
wrapper.find('a').trigger('click') expect(wrapper.find('.callout-warning').exists()).toBeTrue()
expect(Vue.prototype.$alert).toBeCalledWith('the policy', {
dangerouslyUseHTMLString: true,
})
}) })