Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Tools glue
ng-ebi-authorization
Commits
f8c10ad7
Commit
f8c10ad7
authored
Jan 24, 2019
by
Eduardo Sanz García
Browse files
test (AuthService): fix problem in headless
parent
68f38c16
Pipeline
#12154
failed with stages
in 1 minute and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
src/app/modules/auth/auth.service.spec.ts
src/app/modules/auth/auth.service.spec.ts
+10
-5
No files found.
src/app/modules/auth/auth.service.spec.ts
View file @
f8c10ad7
...
...
@@ -188,12 +188,17 @@ describe('AuthService', () => {
// defaults
width
=
650
;
height
=
4
00
;
height
=
10
00
;
service
.
openLoginWindow
();
left
=
Math
.
round
((
window
.
screen
.
width
-
width
)
/
2
);
expect
(
left
+
width
+
left
).
toBe
(
window
.
screen
.
width
);
expect
(
left
+
width
+
left
).
toBe
(
window
.
screen
.
width
,
'
left should be such it "fills" the width of the screen
'
);
top
=
Math
.
round
((
window
.
screen
.
height
-
height
)
/
2
);
expect
(
top
+
height
+
top
).
toBe
(
window
.
screen
.
height
);
if
(
top
<
0
)
{
expect
(
top
+
height
+
top
).
toBe
(
window
.
screen
.
height
,
'
top should be such it "fills" the height of the screen
'
);
}
else
{
// chromium headless screen.height is 600px
top
=
-
1
;
}
expect
(
open
).
toHaveBeenCalledWith
(
`
${(
service
as
any
).
_appURL
}
/sso?from=http%3A%2F%2Flocalhost%3A9876`
,
'
Sign in to Elixir
'
,
...
...
@@ -214,9 +219,9 @@ describe('AuthService', () => {
height
=
40
;
service
.
openLoginWindow
({},
width
,
height
);
left
=
Math
.
round
((
window
.
screen
.
width
-
width
)
/
2
);
expect
(
left
+
width
+
left
).
toBe
(
window
.
screen
.
width
);
expect
(
left
+
width
+
left
).
toBe
(
window
.
screen
.
width
,
'
left should be such it "fills" the width of the screen
'
);
top
=
Math
.
round
((
window
.
screen
.
height
-
height
)
/
2
);
expect
(
top
+
height
+
top
).
toBe
(
window
.
screen
.
height
);
expect
(
top
+
height
+
top
).
toBe
(
window
.
screen
.
height
,
'
top should be such it "fills" the height of the screen
'
);
expect
(
open
).
toHaveBeenCalledWith
(
`
${(
service
as
any
).
_appURL
}
/sso?from=http%3A%2F%2Flocalhost%3A9876`
,
'
Sign in to Elixir
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment