mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-13 11:34:02 +08:00
Badge: fix type class when is-dot (#21308)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
v-text="content"
|
||||
class="el-badge__content"
|
||||
:class="[
|
||||
'el-badge__content--' + type,
|
||||
type ? 'el-badge__content--' + type : null,
|
||||
{
|
||||
'is-fixed': $slots.default,
|
||||
'is-dot': isDot
|
||||
|
||||
@@ -32,6 +32,17 @@ describe('Badge', () => {
|
||||
expect(vm.$el.querySelector('.el-badge__content.is-dot')).to.exist;
|
||||
});
|
||||
|
||||
it('is dot with type', () => {
|
||||
vm = createVue(`
|
||||
<el-badge is-dot type="success">
|
||||
<button>click</button>
|
||||
</el-badge>
|
||||
`);
|
||||
|
||||
expect(vm.$el.querySelector('.el-badge__content.is-dot')).to.exist;
|
||||
expect(vm.$el.querySelector('.el-badge__content.el-badge__content--success.is-dot')).to.exist;
|
||||
});
|
||||
|
||||
it('max', () => {
|
||||
vm = createTest(Badge, { max: 100, value: 200 });
|
||||
expect(vm.content).to.equal('100+');
|
||||
|
||||
Reference in New Issue
Block a user