import { mount } from '@vue/test-utils';
import SignInPage from '../../src/views/SignInPage';
import makeStore from '../makeStore';

jest.mock('kolibri.urls');

function makeWrapper() {
  return mount(SignInPage, {
    store: makeStore(),
  });
}

describe('signInPage component', () => {
  it('smoke test', () => {
    const wrapper = makeWrapper();
    expect(wrapper.isVueInstance()).toEqual(true);
  });
});

@@ -401,12 +401,1050 @@
 ;%0A  %7D);%0A
+  it('will set the username as invalid if it contains punctuation and is blurred', () =%3E %7B%0A    const wrapper = makeWrapper();%0A    wrapper.setData(%7B username: '?', usernameBlurred: true %7D);%0A    expect(wrapper.vm.usernameIsInvalid).toEqual(true);%0A  %7D);%0A  it('will set the form as not valid if the username is invalid and is blurred', () =%3E %7B%0A    const wrapper = makeWrapper();%0A    wrapper.setData(%7B username: '?', usernameBlurred: true %7D);%0A    expect(wrapper.vm.formIsValid).toEqual(false);%0A  %7D);%0A  it('will set the validation text to required if the username is empty and blurred', () =%3E %7B%0A    const wrapper = makeWrapper();%0A    wrapper.setData(%7B username: '', usernameBlurred: true %7D);%0A    expect(wrapper.vm.usernameIsInvalidText).toEqual(wrapper.vm.$options.$trs.required);%0A  %7D);%0A  it('will set the validation text to empty if the username is empty and not blurred', () =%3E %7B%0A    const wrapper = makeWrapper();%0A    wrapper.setData(%7B username: '', usernameBlurred: false %7D);%0A    expect(wrapper.vm.usernameIsInvalidText).toEqual('');%0A  %7D);%0A
 %7D);%0A

Add tests of username validation on sign in page.