-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// import {TaskQueue} from 'aurelia-task-queue'; | ||
import {initialize} from 'aurelia-pal-browser'; | ||
import {MdButton} from 'src/button/button'; | ||
|
||
describe('Button', () => { | ||
let element; | ||
// let taskQueue; | ||
let button; | ||
|
||
beforeEach(() => { | ||
initialize(); | ||
|
||
element = document.createElement('a'); | ||
document.body.appendChild(element); | ||
|
||
// taskQueue = new TaskQueue(); | ||
button = new MdButton(element); | ||
}); | ||
|
||
it('sets btn class', () => { | ||
button.attached(); | ||
expect(element.classList.contains('btn')).toBe(true); | ||
}); | ||
|
||
it('sets accent class', () => { | ||
button.attached(); | ||
expect(element.classList.contains('accent')).toBe(true); | ||
}); | ||
|
||
it('sets flat class if flat is specified', () => { | ||
button.flat = true; | ||
button.attached(); | ||
expect(element.classList.contains('btn-flat')).toBe(true); | ||
}); | ||
|
||
it('does not set accent class if flat is specified', () => { | ||
button.flat = true; | ||
button.attached(); | ||
expect(element.classList.contains('btn-flat')).toBe(true); | ||
expect(element.classList.contains('accent')).toBe(false); | ||
}); | ||
|
||
it('sets large class if large is specified', () => { | ||
button.large = true; | ||
button.attached(); | ||
expect(element.classList.contains('btn-large')).toBe(true); | ||
}); | ||
|
||
it('sets disabled class if disabled is specified', () => { | ||
button.disabled = true; | ||
button.attached(); | ||
expect(element.classList.contains('disabled')).toBe(true); | ||
}); | ||
}); |