registration tests

This commit is contained in:
realaravinth
2021-05-06 13:48:28 +05:30
parent 14859ab594
commit b5a9c0d772
29 changed files with 6850 additions and 123 deletions

View File

@@ -16,44 +16,18 @@
*/
import getFormUrl from './getFormUrl';
import {getLoginFormHtml} from '../setUpTests';
'use strict';
const formClassName = 'form__box';
const formURL = '/api/v1/signin';
document.body.innerHTML = `
<form method="POST" action="${formURL}" class="${formClassName}" id="form">
<label class="form__in-group" for="username"
>Username
<input
class="form__in-field"
id="username"
type="text"
name="username"
required=""
autofocus="true"
/>
</label>
document.body.innerHTML = getLoginFormHtml();
<label for="password" class="form__in-group"
>Password
<input
class="form__in-field"
type="password"
id="password"
name="password"
required=""
/>
<!--
<a class="form__pw-recovery" -href="/recovert/password"
>Forgot password?</a
>
-->
</label>
<input type="submit" class="form__submit-button" value="Sign in" />
</form>
`;
const form = document.querySelector('form');
form.action = formURL;
form.className = formClassName;
it('getFromUrl workds', () => {
const name = `.${formClassName}`;

View File

@@ -16,12 +16,11 @@
*/
import isBlankString from './isBlankString';
import {mockAlert} from '../setUpTests';
'use strict';
delete window.alert;
window.alert = (x: any) => console.log(x);
mockAlert();
it('getFromUrl workds', () => {
expect(isBlankString('test', 'username')).toBe(false);