diff --git a/app/assets/javascripts/timeoutPopup.js b/app/assets/javascripts/timeoutPopup.js
index af9a9d1cb..0a98ea3d7 100644
--- a/app/assets/javascripts/timeoutPopup.js
+++ b/app/assets/javascripts/timeoutPopup.js
@@ -12,21 +12,17 @@
var seconds = Math.floor((difference % (1000 * 60)) / 1000);
document.getElementById("timeLeft").innerHTML = + minutes + "m " + seconds + "s";
showTimer();
- document.getElementById("logOutTimer").addEventListener("click", logoutByUser);
+ document.getElementById("logOutTimer").addEventListener("click", logoutUser);
document.getElementById("extendSessionTimer").addEventListener("click", extendSession);
if (difference < 0) {
clearInterval(x);
closeTimer();
- redirectToSignin();
+ logoutUser();
}
}, 1000);
- }, 60 * 1000);
+ }, 25 * 60 * 1000);
- function redirectToSignin() {
- window.location.href = '/sign-in';
- }
-
- function logoutByUser() {
+ function logoutUser() {
window.location.href = '/sign-out';
}
diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html
index 86a9847c3..8a7aa49b1 100644
--- a/app/templates/admin_template.html
+++ b/app/templates/admin_template.html
@@ -11,47 +11,6 @@
{% endblock %}
{% block head %}
-{# {% if current_user.is_authenticated %}#}
-{# {% block sessionUserWarning %}#}
-{# #}
-{# #}
-{# {% endblock %}#}
-{# {% endif %}#}
{%- for font in font_paths %}
{%- endfor %}
diff --git a/tests/javascripts/timeoutPopup.test.js b/tests/javascripts/timeoutPopup.test.js
new file mode 100644
index 000000000..a91e667ea
--- /dev/null
+++ b/tests/javascripts/timeoutPopup.test.js
@@ -0,0 +1,18 @@
+const timeoutPopup = require('../../app/assets/javascripts/timeoutPopup.js');
+
+
+describe('Test popup process', () => {
+ beforeEach(() => {
+ jest.useFakeTimers();
+ });
+
+ afterEach(() => {
+ jest.useRealTimers();
+ });
+
+ it('Test timers work', () => {
+ jest.runAllTimers();
+ });
+
+});
+