Skip to content

Commit

Permalink
Badge: fix type class when is-dot (#21308)
Browse files Browse the repository at this point in the history
  • Loading branch information
adaex committed Sep 16, 2021
1 parent 95445e2 commit 492ab00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/badge/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions test/unit/specs/badge.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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+');
Expand Down

0 comments on commit 492ab00

Please sign in to comment.