Skip to content

Commit

Permalink
fix: Fixes tests and css (#744)
Browse files Browse the repository at this point in the history
* fix: Fixes failing tests
* fix: Fixes css
* Fixes e2e tests
  • Loading branch information
manueltanzi-okta committed Jul 2, 2019
1 parent 5b6a9d2 commit e01973c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 33 deletions.
12 changes: 4 additions & 8 deletions assets/sass/modules/_mfa-challenge-forms.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// inline totp form //
.mfa-verify-totp-inline {

.inline-input {
width: 212px;
float: left;
Expand Down Expand Up @@ -31,20 +30,18 @@
display: block;
text-align: center;
}

}

// sms and call forms
.mfa-verify-passcode {

.link-button {
float: left;
float: right;
margin-top: 30px;
}

.auth-passcode .o-form-input {
.auth-passcode {
float: left;
width: 180px;
float: right;

@include device-mq(x-small) {
width: 170px;
}
Expand All @@ -53,7 +50,6 @@
width: 100%;
}
}

}

// Duo
Expand Down
16 changes: 8 additions & 8 deletions src/views/mfa-verify/PassCodeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ define(['okta', 'q', 'views/shared/TextBox'], function (Okta, Q, TextBox) {
this.listenTo(this.model, 'error', function () {
this.clearErrors();
});
this.addInput({
label: Okta.loc('mfa.challenge.enterCode.placeholder', 'login'),
'label-top': true,
className: 'o-form-fieldset o-form-label-top auth-passcode',
name: 'answer',
input: TextBox,
type: 'tel'
});
this.add(Okta.createButton({
attributes: { 'data-se': formAndButtonDetails.buttonDataSe },
className: 'button ' + formAndButtonDetails.buttonClassName,
Expand Down Expand Up @@ -125,14 +133,6 @@ define(['okta', 'q', 'views/shared/TextBox'], function (Okta, Q, TextBox) {
}, this));
}
}));
this.addInput({
label: Okta.loc('mfa.challenge.enterCode.placeholder', 'login'),
'label-top': true,
className: 'o-form-fieldset o-form-label-top auth-passcode',
name: 'answer',
input: TextBox,
type: 'tel'
});
if (this.options.appState.get('allowRememberDevice')) {
this.addInput({
label: false,
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/angular-app/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
],
"styles": [
"src/styles.css",
"../../../dist/css/okta-sign-in.min.css",
"../../../dist/css/okta-theme.css"
"../../../dist/css/okta-sign-in.min.css"
],
"scripts": []
},
Expand Down
1 change: 0 additions & 1 deletion test/e2e/layouts/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="css/okta-sign-in.css" type="text/css" rel="stylesheet"/>
<link href="css/okta-theme.css" type="text/css" rel="stylesheet"/>
</head>

<body>
Expand Down
1 change: 0 additions & 1 deletion test/e2e/react-app/config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = {
Object.assign(config.resolve.alias, {
'@okta/okta-signin-widget': MAIN_ENTRY,
'okta-sign-in.min.css': path.resolve(ROOT_DIR, 'dist', 'css', 'okta-sign-in.min.css'),
'okta-theme.css': path.resolve(ROOT_DIR, 'dist', 'css', 'okta-theme.css'),
});
// Remove the 'ModuleScopePlugin' which keeps us from requiring outside the src/ dir
config.resolve.plugins = [];
Expand Down
23 changes: 11 additions & 12 deletions test/e2e/templates/done.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ var oktaSignIn = new OktaSignIn({
});
addMessageToPage('page', 'oidc_app');

if (oktaSignIn.token.hasTokensInUrl()) {
oktaSignIn.token.parseTokensFromUrl(
function (res) {
var tokens = Array.isArray(res) ? res : [res];
for (var i = 0; i < tokens.length; ++i) {
if (tokens[i].idToken) {
addMessageToPage('idtoken_user', tokens[i].claims.name);
if (oktaSignIn.hasTokensInUrl()) {
oktaSignIn.authClient.token.parseFromUrl()
.then(function (res) {
var tokens = Array.isArray(res) ? res : [res];
for (var i = 0; i < tokens.length; ++i) {
if (tokens[i].idToken) {
addMessageToPage('idtoken_user', tokens[i].claims.name);
}
}
}
},
function (err) {
})
.fail(function (err) {
addMessageToPage('oidc_error', JSON.stringify(err));
}
);
});
}
{{/cdnLayout}}
2 changes: 1 addition & 1 deletion test/unit/spec/LoginRouter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function (Okta, Q, Logger, Errors, BrowserFeatures, WidgetUtil, Bundles, config,

// Verify that the translation is being applied
var loginBundle = $.ajax.calls.all()[0].returnValue.responseJSON;
var title = loginBundle['password.expired.title'];
var title = loginBundle['password.expired.title.generic'];
var $title = $sandbox.find('.password-expired .okta-form-title');
expect($title.length).toBe(1);
expect($title.text()).toBe(title);
Expand Down

0 comments on commit e01973c

Please sign in to comment.