Skip to content

Commit

Permalink
MNT ESLint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Talipova committed Jul 7, 2023
1 parent a8c9436 commit 64eb6bd
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 41 deletions.
1 change: 0 additions & 1 deletion client/src/boot/registerReducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ export default () => {
// See MFA "method availability reducer" naming conventions in the documentation
Injector.reducer.register('web-authnAvailability', webauthnAvailableReducer);
};

1 change: 1 addition & 0 deletions client/src/bundles/bundle.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
// Include any legacy Entwine wrappers

// Include boot entrypoint
Expand Down
16 changes: 8 additions & 8 deletions client/src/components/WebAuthn/Verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ class Verify extends Component {
}

if (failure) {
return (
<div className="mfa-verification-container__status status-message--failure">
<span className="status-message__icon"><CircleWarning size="32px" /></span>
<span className="status-message__description">
{i18n._t('MFAWebAuthnVerify.FAILURE', fallbacks['MFAWebAuthnVerify.FAILURE'])}
</span>
</div>
);
return (
<div className="mfa-verification-container__status status-message--failure">
<span className="status-message__icon"><CircleWarning size="32px" /></span>
<span className="status-message__description">
{i18n._t('MFAWebAuthnVerify.FAILURE', fallbacks['MFAWebAuthnVerify.FAILURE'])}
</span>
</div>
);
}

return (
Expand Down
12 changes: 6 additions & 6 deletions client/src/components/WebAuthn/tests/Register-test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* global jest, test, describe, it, each, expect */

import { Component as Register, VIEWS } from '../Register';
import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import { Component as Register } from '../Register';

window.ss = {
i18n: {
Expand All @@ -15,11 +15,11 @@ let resolveRegistration;
let rejectRegistration;

jest.mock('lib/auth', () => ({
performRegistration: () => new Promise((resolve, reject) => {
resolveRegistration = resolve;
rejectRegistration = reject;
})
}));
performRegistration: () => new Promise((resolve, reject) => {
resolveRegistration = resolve;
rejectRegistration = reject;
})
}));

function makeProps(obj = {}) {
return {
Expand Down
12 changes: 6 additions & 6 deletions client/src/components/WebAuthn/tests/Verify-test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* global jest, test, describe, it, each, expect */

import Verify from '../Verify';
import React from 'react';
import { render, fireEvent, screen, act } from '@testing-library/react';
import { render, fireEvent, screen } from '@testing-library/react';
import Verify from '../Verify';

window.ss = {
i18n: {
Expand Down Expand Up @@ -31,9 +31,9 @@ let rejectVerification;

jest.mock('lib/auth', () => ({
performVerification: () => new Promise((resolve, reject) => {
resolveVerification = resolve;
rejectVerification = reject;
})
resolveVerification = resolve;
rejectVerification = reject;
})
}));

test('Verify retry clears failure state', async () => {
Expand Down Expand Up @@ -142,7 +142,7 @@ test('Verify renders a retry button when in a failure state', async () => {
test('Verify renders only the "moreOptionsControl" prop provided when in waiting state', () => {
const { container } = render(
<Verify {...makeProps({
moreOptionsControl: <div className="test-more-options">Hello world</div>
moreOptionsControl: <div className="test-more-options">Hello world</div>
})}
/>
);
Expand Down
40 changes: 20 additions & 20 deletions client/src/lib/tests/convert-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
import { base64ToByteArray, byteArrayToBase64 } from '../convert';

describe('convert', () => {
it('converts base64ToByteArray', () => {
const string = 'abc/def+ghi';
const expected = new Uint8Array([105, 183, 63, 117, 231, 254, 130, 24]);
const actual = base64ToByteArray(string);
expect(expected).toEqual(actual);
});
it('converts base64ToByteArray', () => {
const string = 'abc/def+ghi';
const expected = new Uint8Array([105, 183, 63, 117, 231, 254, 130, 24]);
const actual = base64ToByteArray(string);
expect(expected).toEqual(actual);
});

it('converts base64ToByteArray when encoded web-safe', () => {
const string = 'abc_def-ghi';
const expected = new Uint8Array([105, 183, 63, 117, 231, 254, 130, 24]);
const actual = base64ToByteArray(string);
expect(expected).toEqual(actual);
});
it('converts base64ToByteArray when encoded web-safe', () => {
const string = 'abc_def-ghi';
const expected = new Uint8Array([105, 183, 63, 117, 231, 254, 130, 24]);
const actual = base64ToByteArray(string);
expect(expected).toEqual(actual);
});

it('converts byteArrayToBase64', () => {
const byteArray = [105, 183, 63, 117, 231, 254, 130, 24];
// this is supposed to be slightly different from string
// used in base64ToByteArray tests
const expected = 'abc/def+ghg';
const actual = byteArrayToBase64(byteArray);
expect(expected).toEqual(actual);
});
it('converts byteArrayToBase64', () => {
const byteArray = [105, 183, 63, 117, 231, 254, 130, 24];
// this is supposed to be slightly different from string
// used in base64ToByteArray tests
const expected = 'abc/def+ghg';
const actual = byteArrayToBase64(byteArray);
expect(expected).toEqual(actual);
});
});

0 comments on commit 64eb6bd

Please sign in to comment.