Skip to content

Commit f8ed01a

Browse files
author
esuau
committed
#197 Restore immutable class in native attribute
1 parent 864babe commit f8ed01a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/switch/switch.component.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ describe("SwitchComponent", () => {
3232
expect(component instanceof SwitchComponent).toBe(true);
3333
});
3434

35+
it("should have input with class 'bx--toggle'", () => {
36+
expect(buttonElement.className.includes("bx--toggle")).toEqual(true);
37+
component.size = "sm";
38+
fixture.detectChanges();
39+
expect(buttonElement.className.includes("bx--toggle")).toEqual(true);
40+
});
41+
3542
it("should change state", () => {
3643
buttonElement.click();
3744
fixture.detectChanges();

src/switch/switch.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export class SwitchChange {
5252
selector: "ibm-switch",
5353
template: `
5454
<input
55+
class="bx--toggle"
5556
[ngClass]="{
56-
'bx--toggle': true,
5757
'bx--toggle--small': size === 'sm'
5858
}"
5959
[id]="id"

0 commit comments

Comments
 (0)