Fix form submission issues. (#50)

* Fix form submission issues.

Fixed form submission issues on first click and
with optional fields check. Also fixed some warnings
and did some refactoring as well.

VAN-225, VAN-206

* added more tests
This commit is contained in:
Waheed Ahmed
2020-12-23 18:07:37 +05:00
committed by GitHub
parent ebcc8bd02f
commit fcdce291bb
9 changed files with 259 additions and 111 deletions

View File

@@ -3,4 +3,20 @@
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { getConfig } from '@edx/frontend-platform';
import { configure as configureLogging } from '@edx/frontend-platform/logging';
Enzyme.configure({ adapter: new Adapter() });
class MockLoggingService {
logInfo = jest.fn();
logError = jest.fn();
}
export default function initializeMockLogging() {
const loggingService = configureLogging(MockLoggingService, {
config: getConfig(),
});
return { loggingService };
}