Skip to content

Commit 87bd47e

Browse files
committed
add tests for user-provided class attr passthrough on FontAwesomeLayersText
1 parent 342423a commit 87bd47e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/components/__tests__/FontAwesomeLayersText.test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,32 @@ describe('counter', () => {
8080
})
8181
})
8282

83+
describe('class attr', () => {
84+
test('user-provided class is applied alongside fa-layers-text', () => {
85+
const wrapper = compileAndMount({
86+
template: '<font-awesome-layers-text value="New!" class="gray8" />',
87+
components: {
88+
FontAwesomeLayersText
89+
}
90+
})
91+
92+
expect(wrapper.element.classList.contains('fa-layers-text')).toBe(true)
93+
expect(wrapper.element.classList.contains('gray8')).toBe(true)
94+
})
95+
96+
test('user-provided class does not replace fa-layers-counter', () => {
97+
const wrapper = compileAndMount({
98+
template: '<font-awesome-layers-text :value="42" :counter="true" class="my-counter" />',
99+
components: {
100+
FontAwesomeLayersText
101+
}
102+
})
103+
104+
expect(wrapper.element.classList.contains('fa-layers-counter')).toBe(true)
105+
expect(wrapper.element.classList.contains('my-counter')).toBe(true)
106+
})
107+
})
108+
83109
describe('reactivity', () => {
84110
test('changing props should update the element', async () => {
85111
const wrapper = compileAndMount({

0 commit comments

Comments
 (0)