error handling in auth

This commit is contained in:
realaravinth
2021-06-28 23:03:15 +05:30
parent d298ef4719
commit c581d8d0a3
12 changed files with 51 additions and 15 deletions

View File

@@ -18,16 +18,12 @@
import createError from './index';
import * as e from './index';
import setup from './setUpTests';
'use strict';
jest.useFakeTimers();
const setup = () => {
let x = document.createElement('div');
x.id = e.ERR_CONTAINER_ID;
return x;
};
it('checks if error boxes work', () => {
document.body.append(setup());

View File

@@ -0,0 +1 @@
<div id="err__container"></div>

View File

@@ -0,0 +1,25 @@
/*
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import * as e from './index';
const setup = () => {
let x = document.createElement('div');
x.id = e.ERR_CONTAINER_ID;
return x;
};
export default setup;

View File

@@ -15,5 +15,6 @@
href="<.= &*crate::MOBILE_CSS .>"
/>
<script src="<.= &*crate::JS .>"></script>
<. include!("../components/error/index.html"); .>
</body>
</html>