Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
832
Issues
832
List
Boards
Labels
Service Desk
Milestones
Merge Requests
45
Merge Requests
45
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Compare Revisions
abacd0ded92bfb1a52b6d8098cde6e88ce039250...8ee8ba1b554d27bf0b0d995843939ab9f009cf9e
Source
8ee8ba1b554d27bf0b0d995843939ab9f009cf9e
Select Git revision
...
Target
abacd0ded92bfb1a52b6d8098cde6e88ce039250
Select Git revision
Compare
Commits (2)
(fix): issue with social profiles
· 16dccc25
Marcelo Rivera
authored
56 minutes ago
16dccc25
(fix): spec tests
· 8ee8ba1b
Marcelo Rivera
authored
14 minutes ago
8ee8ba1b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
23 deletions
+45
-23
login.component.spec.ts
src/app/modules/auth/login.component.spec.ts
+1
-1
sidebar.spec.ts
src/app/modules/channels/sidebar/sidebar.spec.ts
+6
-0
meta.ts
src/app/modules/channels/social-profiles/meta.ts
+3
-3
login.spec.ts
src/app/modules/forms/login/login.spec.ts
+16
-12
newsfeed.component.spec.ts
src/app/modules/newsfeed/newsfeed.component.spec.ts
+1
-0
notification.component.spec.ts
src/app/modules/notifications/notification.component.spec.ts
+4
-4
notification.service.spec.ts
src/app/modules/notifications/notification.service.spec.ts
+14
-3
No files found.
src/app/modules/auth/login.component.spec.ts
View file @
8ee8ba1b
...
...
@@ -115,7 +115,7 @@ describe('LoginComponent', () => {
);
expect
(
h3
).
not
.
toBeNull
();
expect
(
h3
.
nativeElement
.
textContent
).
toContain
(
'
Not on Minds? Start a channel
'
'
Not on Minds? Start a
Minds
channel
'
);
expect
(
fixture
.
debugElement
.
query
(
By
.
css
(
'
minds-form-register
'
))
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/channels/sidebar/sidebar.spec.ts
View file @
8ee8ba1b
...
...
@@ -106,6 +106,11 @@ describe('ChannelSidebar', () => {
selector
:
'
m-channel-mode-selector
'
,
inputs
:
[
'
user
'
,
'
enabled
'
],
}),
MockComponent
({
selector
:
'
m-tooltip
'
,
template
:
'
<ng-content></ng-content>
'
,
inputs
:
[
'
icon
'
,
'
iconClass
'
],
}),
IfFeatureDirective
,
],
imports
:
[
FormsModule
,
RouterTestingModule
,
NgCommonModule
],
...
...
@@ -140,6 +145,7 @@ describe('ChannelSidebar', () => {
fixture
=
TestBed
.
createComponent
(
ChannelSidebar
);
featuresServiceMock
.
mock
(
'
es-feeds
'
,
false
);
featuresServiceMock
.
mock
(
'
permissions
'
,
true
);
featuresServiceMock
.
mock
(
'
pro
'
,
true
);
clientMock
.
response
=
{};
uploadMock
.
response
=
{};
comp
=
fixture
.
componentInstance
;
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/channels/social-profiles/meta.ts
View file @
8ee8ba1b
...
...
@@ -220,9 +220,9 @@ export function getSocialProfileMeta(key: string): SocialProfileMeta {
return
defaultMeta
;
}
for
(
let
i
in
this
.
socialProfiles
Meta
)
{
if
(
this
.
socialProfiles
Meta
[
i
].
key
===
key
)
{
return
this
.
socialProfiles
Meta
[
i
];
for
(
let
i
in
socialProfile
Meta
)
{
if
(
socialProfile
Meta
[
i
].
key
===
key
)
{
return
socialProfile
Meta
[
i
];
}
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/forms/login/login.spec.ts
View file @
8ee8ba1b
...
...
@@ -28,9 +28,6 @@ describe('LoginForm', () => {
let
loginButton
:
DebugElement
;
let
errorMessage
:
DebugElement
;
let
twoFactorForm
:
DebugElement
;
let
twoFactorCode
:
DebugElement
;
let
twoFactorLoginButton
:
DebugElement
;
let
session
:
Session
;
function
login
(
response
,
_username
=
'
username
'
)
{
...
...
@@ -52,6 +49,7 @@ describe('LoginForm', () => {
}
function
twoFactorLogin
(
response
)
{
const
twoFactorCode
=
getTwoFactorCode
();
twoFactorCode
.
nativeElement
.
value
=
'
123123
'
;
twoFactorCode
.
nativeElement
.
dispatchEvent
(
new
Event
(
'
input
'
));
...
...
@@ -62,12 +60,24 @@ describe('LoginForm', () => {
tick
();
fixture
.
detectChanges
();
twoFactorLoginButton
.
nativeElement
.
click
();
getTwoFactorLoginButton
()
.
nativeElement
.
click
();
tick
();
fixture
.
detectChanges
();
}
function
getTwoFactorForm
()
{
return
fixture
.
debugElement
.
query
(
By
.
css
(
'
.minds-login-box:last-of-type
'
));
}
function
getTwoFactorCode
()
{
return
fixture
.
debugElement
.
query
(
By
.
css
(
'
#code
'
));
}
function
getTwoFactorLoginButton
()
{
return
fixture
.
debugElement
.
query
(
By
.
css
(
'
.mdl-card > button
'
));
}
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
...
...
@@ -95,13 +105,6 @@ describe('LoginForm', () => {
password
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
#password
'
));
loginButton
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
.m-btn--login
'
));
errorMessage
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
.m-error-box
'
));
twoFactorForm
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
.minds-login-box:last-of-type
'
)
);
twoFactorCode
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
#code
'
));
twoFactorLoginButton
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
.mdl-card > button
'
)
);
session
=
comp
.
session
;
...
...
@@ -244,7 +247,8 @@ describe('LoginForm', () => {
login
({
status
:
'
error
'
,
code
:
'
403
'
,
message
:
'
imaprettymessage
'
});
expect
(
loginForm
.
nativeElement
.
hidden
).
toBeTruthy
();
expect
(
twoFactorForm
.
nativeElement
.
hidden
).
toBeFalsy
();
expect
(
getTwoFactorForm
().
nativeElement
.
hidden
).
toBeFalsy
();
}));
it
(
'
should spawn error message when incorrect code is written
'
,
fakeAsync
(()
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/newsfeed/newsfeed.component.spec.ts
View file @
8ee8ba1b
...
...
@@ -122,6 +122,7 @@ describe('NewsfeedComponent', () => {
clientMock
.
response
=
{};
featuresServiceMock
.
mock
(
'
top-feeds
'
,
false
);
featuresServiceMock
.
mock
(
'
suggested-users
'
,
false
);
featuresServiceMock
.
mock
(
'
pro
'
,
false
);
sessionMock
.
user
.
admin
=
false
;
sessionMock
.
loggedIn
=
true
;
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/notifications/notification.component.spec.ts
View file @
8ee8ba1b
...
...
@@ -23,7 +23,7 @@ import { sessionMock } from '../../../tests/session-mock.spec';
import
{
ExcerptPipe
}
from
'
../../common/pipes/excerpt
'
;
describe
(
'
Notification
s
Component
'
,
()
=>
{
describe
(
'
NotificationComponent
'
,
()
=>
{
let
comp
:
NotificationComponent
;
let
fixture
:
ComponentFixture
<
NotificationComponent
>
;
...
...
@@ -248,7 +248,7 @@ describe('NotificationsComponent', () => {
fixture
.
detectChanges
();
expect
(
comp
.
notification
).
not
.
toBeNull
();
const
notification
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
p
'
));
expect
(
notification
.
nativeElement
.
innerHTML
).
to
Be
(
expect
(
notification
.
nativeElement
.
innerHTML
).
to
Contain
(
'
name tagged you in a post
'
);
});
...
...
@@ -276,7 +276,7 @@ describe('NotificationsComponent', () => {
fixture
.
detectChanges
();
expect
(
comp
.
notification
).
not
.
toBeNull
();
const
notification
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
p
'
));
expect
(
notification
.
nativeElement
.
innerHTML
).
to
Be
(
expect
(
notification
.
nativeElement
.
innerHTML
).
to
Contain
(
'
name tagged you in a comment
'
);
});
...
...
@@ -518,7 +518,7 @@ describe('NotificationsComponent', () => {
fixture
.
detectChanges
();
expect
(
comp
.
notification
).
not
.
toBeNull
();
const
notification
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
p
'
));
expect
(
notification
.
nativeElement
.
innerHTML
).
to
Be
(
expect
(
notification
.
nativeElement
.
innerHTML
).
to
Contain
(
'
You can gain more reach by boosting your content. Hit the blue boost icon on your posts.
'
);
});
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/notifications/notification.service.spec.ts
View file @
8ee8ba1b
...
...
@@ -3,7 +3,17 @@ import { clientMock } from '../../../tests/client-mock.spec';
import
{
sessionMock
}
from
'
../../../tests/session-mock.spec
'
;
import
{
socketMock
}
from
'
../../../tests/socket-mock.spec
'
;
import
{
fakeAsync
,
tick
}
from
'
@angular/core/testing
'
;
import
{
mindsTitleMock
}
from
'
../../../app/mocks/services/ux/minds-title.service.mock.spec
'
;
import
{
mindsTitleMock
}
from
'
../../mocks/services/ux/minds-title.service.mock.spec
'
;
import
{
MockService
}
from
'
../../utils/mock
'
;
import
{
SiteService
}
from
'
../../services/site.service
'
;
import
{
EventEmitter
}
from
'
@angular/core
'
;
export
let
siteServiceMock
=
new
(
function
()
{
var
pro
=
()
=>
null
;
var
isProDomain
=
()
=>
false
;
var
title
=
()
=>
'
Minds
'
;
var
isAdmin
=
()
=>
true
;
})();
describe
(
'
NewsfeedService
'
,
()
=>
{
let
service
:
NotificationService
;
...
...
@@ -12,10 +22,11 @@ describe('NewsfeedService', () => {
jasmine
.
clock
().
uninstall
();
jasmine
.
clock
().
install
();
service
=
new
NotificationService
(
clientMock
,
sessionMock
,
clientMock
,
socketMock
,
mindsTitleMock
mindsTitleMock
,
siteServiceMock
);
clientMock
.
response
=
{};
});
...
...
This diff is collapsed.
Click to expand it.