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

View File

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