Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend-clients
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
frontend-clients
Commits
5a9873f7
Commit
5a9873f7
authored
1 year ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
OZG-4321 manuell navigation to avoid iss parameter
parent
75acbee7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
alfa-client/apps/admin/src/app/app.component.spec.ts
+13
-0
13 additions, 0 deletions
alfa-client/apps/admin/src/app/app.component.spec.ts
alfa-client/apps/admin/src/app/app.component.ts
+3
-0
3 additions, 0 deletions
alfa-client/apps/admin/src/app/app.component.ts
with
16 additions
and
0 deletions
alfa-client/apps/admin/src/app/app.component.spec.ts
+
13
−
0
View file @
5a9873f7
...
...
@@ -11,6 +11,7 @@ import { createApiRootResource } from 'libs/api-root-shared/test/api-root';
import
{
MockComponent
}
from
'
ng-mocks
'
;
import
{
UserProfileButtonContainerComponent
}
from
'
../common/user-profile-button-container/user-profile.button-container.component
'
;
import
{
PostfachNavigationItemComponent
}
from
'
../pages/postfach/postfach-navigation-item/postfach-navigation-item.component
'
;
import
{
Router
}
from
'
@angular/router
'
;
describe
(
'
AppComponent
'
,
()
=>
{
let
component
:
AppComponent
;
...
...
@@ -25,6 +26,8 @@ describe('AppComponent', () => {
...
mock
(
AuthService
),
login
:
jest
.
fn
().
mockResolvedValue
(
Promise
.
resolve
()),
};
const
router
:
Mock
<
Router
>
=
mock
(
Router
);
const
apiRootService
:
Mock
<
ApiRootService
>
=
mock
(
ApiRootService
);
beforeEach
(
async
()
=>
{
...
...
@@ -44,6 +47,10 @@ describe('AppComponent', () => {
provide
:
ApiRootService
,
useValue
:
apiRootService
,
},
{
provide
:
Router
,
useValue
:
router
,
},
],
}).
compileComponents
();
});
...
...
@@ -82,6 +89,12 @@ describe('AppComponent', () => {
expect
(
apiRootService
.
getApiRoot
).
toHaveBeenCalled
();
});
it
(
'
should navigate to default route
'
,
()
=>
{
component
.
doAfterLoggedIn
();
expect
(
router
.
navigate
).
toHaveBeenCalledWith
([
'
/
'
]);
});
});
});
...
...
This diff is collapsed.
Click to expand it.
alfa-client/apps/admin/src/app/app.component.ts
+
3
−
0
View file @
5a9873f7
...
...
@@ -3,6 +3,7 @@ import { Component, OnInit } from '@angular/core';
import
{
Observable
}
from
'
rxjs
'
;
import
{
AuthService
}
from
'
../common/auth/auth.service
'
;
import
{
StateResource
}
from
'
@alfa-client/tech-shared
'
;
import
{
Router
}
from
'
@angular/router
'
;
@
Component
({
selector
:
'
app-root
'
,
...
...
@@ -17,6 +18,7 @@ export class AppComponent implements OnInit {
constructor
(
public
authService
:
AuthService
,
private
apiRootService
:
ApiRootService
,
private
router
:
Router
,
)
{}
ngOnInit
():
void
{
...
...
@@ -25,5 +27,6 @@ export class AppComponent implements OnInit {
doAfterLoggedIn
():
void
{
this
.
apiRootStateResource$
=
this
.
apiRootService
.
getApiRoot
();
this
.
router
.
navigate
([
'
/
'
]);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment