VulpesOS/gaia/apps/camera/test/unit/views/timer_test.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

39 lines
1.2 KiB
JavaScript
Executable file

suite('views/countdown', function() {
'use strict';
suiteSetup(function(done) {
var self = this;
requirejs(['views/countdown'], function(CountdownView) {
self.CountdownView = CountdownView;
done();
});
});
setup(function() {
this.countdown = new this.CountdownView();
this.countdown.emit = sinon.spy();
});
suite('CountdownView#set()', function() {
test('Should update the text content of the counter', function() {
this.countdown.set(1000);
assert.ok(this.countdown.el.innerHTML.indexOf(1000) > -1);
});
});
suite('CountdownView#reset()', function() {
test('Should clear the countdown text', function() {
this.countdown.set(1000);
assert.isTrue(this.countdown.el.innerHTML.indexOf('1000') > -1);
this.countdown.reset();
assert.isFalse(this.countdown.el.innerHTML.indexOf('1000') > -1);
});
test('Should remove `immanent` class', function() {
this.countdown.setImmanent(true);
assert.isTrue(this.countdown.el.classList.contains('immanent'));
this.countdown.reset();
assert.isFalse(this.countdown.el.classList.contains('immanent'));
});
});
});