VulpesOS/gaia/apps/ftu/test/unit/finish_screen_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

42 lines
1,017 B
JavaScript
Executable file

/* global FinishScreen, MocksHelper */
'use strict';
requireApp('ftu/test/unit/mock_screenlayout.js');
requireApp('ftu/js/finish_screen.js');
requireApp('ftu/js/utils.js');
suite('FinishScreen >', function() {
var mocksHelperForFTU = new MocksHelper([
'ScreenLayout'
]).init();
mocksHelperForFTU.attachTestHelpers();
suiteSetup(function() {
mocksHelperForFTU.attachTestHelpers();
loadBodyHTML('/index.html');
});
suiteTeardown(function() {
document.body.innerHTML = '';
});
test(' init', function() {
this.sinon.spy(window, 'close');
// We call to FinishScreen
FinishScreen.init();
// Is shown? We know by default the layout is tiny
assert.isTrue(
document.getElementById('tutorial-finish-tiny').classList.contains('show')
);
// As is tiny, a click should be enough to close the app
document.getElementById('tutorialFinished').click();
assert.isTrue(window.close.calledOnce);
// Reset the spy
window.close.reset();
});
});