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
864
Issues
864
List
Boards
Labels
Service Desk
Milestones
Merge Requests
46
Merge Requests
46
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
8b40f6091d98b5562e7fea022390550b1aeec152...02d78072cacc3fb5748b2e00df79fc3ba4baddb2
Source
02d78072cacc3fb5748b2e00df79fc3ba4baddb2
Select Git revision
...
Target
8b40f6091d98b5562e7fea022390550b1aeec152
Select Git revision
Compare
Commits (2)
(fix): canView attribute should also check for permissions feature flag
· 1dee01d8
Marcelo Rivera
authored
2 hours ago
1dee01d8
(fix): spec tests
· 02d78072
Marcelo Rivera
authored
2 hours ago
02d78072
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
13 deletions
+32
-13
post-menu.component.spec.ts
...p/common/components/post-menu/post-menu.component.spec.ts
+1
-1
channel.component.spec.ts
src/app/modules/channels/channel.component.spec.ts
+21
-9
channel.component.ts
src/app/modules/channels/channel.component.ts
+9
-2
groups-settings-button.spec.ts
...app/modules/groups/profile/groups-settings-button.spec.ts
+1
-1
No files found.
src/app/common/components/post-menu/post-menu.component.spec.ts
View file @
02d78072
...
...
@@ -27,7 +27,7 @@ import { activityServiceMock } from '../../../../tests/activity-service-mock.spe
import
{
storageMock
}
from
'
../../../../tests/storage-mock.spec
'
;
import
{
featuresServiceMock
}
from
'
../../../../tests/features-service-mock.spec
'
;
import
{
Storage
}
from
'
../../../services/storage
'
;
import
{
PermissionsService
}
from
'
../../services/permissions.service
'
;
import
{
PermissionsService
}
from
'
../../services/permissions
/permissions
.service
'
;
import
{
MockService
}
from
'
../../../utils/mock
'
;
/* tslint:disable */
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/channels/channel.component.spec.ts
View file @
02d78072
...
...
@@ -7,13 +7,13 @@ import {
tick
,
}
from
'
@angular/core/testing
'
;
import
{
MockComponent
,
Mock
Directive
,
Mock
Service
}
from
'
../../utils/mock
'
;
import
{
MockComponent
,
MockService
}
from
'
../../utils/mock
'
;
import
{
CommonModule
as
NgCommonModule
}
from
'
@angular/common
'
;
import
{
Router
,
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
Client
}
from
'
../../services/api/client
'
;
import
{
By
,
Title
}
from
'
@angular/platform-browser
'
;
import
{
By
}
from
'
@angular/platform-browser
'
;
import
{
clientMock
}
from
'
../../../tests/client-mock.spec
'
;
import
{
uploadMock
}
from
'
../../../tests/upload-mock.spec
'
;
import
{
sessionMock
}
from
'
../../../tests/session-mock.spec
'
;
...
...
@@ -39,7 +39,7 @@ import { BlockListService } from '../../common/services/block-list.service';
import
{
ChannelMode
}
from
'
../../interfaces/entities
'
;
import
{
ClientMetaService
}
from
'
../../common/services/client-meta.service
'
;
import
{
clientMetaServiceMock
}
from
'
../../../tests/client-meta-service-mock.spec
'
;
import
{
PermissionsService
}
from
'
../../common/services/permissions.service
'
;
import
{
PermissionsService
}
from
'
../../common/services/permissions
/permissions
.service
'
;
describe
(
'
ChannelComponent
'
,
()
=>
{
let
comp
:
ChannelComponent
;
...
...
@@ -185,27 +185,39 @@ describe('ChannelComponent', () => {
const
carousel
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
m-channel--carousel
'
));
const
sidebar
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
m-channel--sidebar
'
));
const
feed
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
m-channel--feed
'
));
expect
(
carousel
).
not
.
toBeNull
();
expect
(
sidebar
).
not
.
toBeNull
();
expect
(
feed
).
not
.
toBeNull
();
comp
.
filter
=
'
supporters
'
;
fixture
.
detectChanges
();
const
supporters
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
m-channel--supporters
'
)
);
expect
(
supporters
).
not
.
toBeNull
();
comp
.
filter
=
'
subscribers
'
;
fixture
.
detectChanges
();
const
subscribers
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
m-channel--subscribers
'
)
);
expect
(
subscribers
).
not
.
toBeNull
();
comp
.
filter
=
'
subscriptions
'
;
fixture
.
detectChanges
();
const
subscriptions
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
m-channel--subscriptions
'
)
);
expect
(
supporters
).
not
.
toBeNull
();
comp
.
filter
=
'
subscriptors
'
;
expect
(
subscriptions
).
not
.
toBeNull
();
comp
.
filter
=
'
requests
'
;
fixture
.
detectChanges
();
const
subscriptor
s
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
m
inds-channel-subscriptors
'
)
const
request
s
=
fixture
.
debugElement
.
query
(
By
.
css
(
'
m
-subscriptionsRequests__list
'
)
);
expect
(
supporter
s
).
not
.
toBeNull
();
expect
(
request
s
).
not
.
toBeNull
();
});
it
(
'
should load() on init
'
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/channels/channel.component.ts
View file @
02d78072
...
...
@@ -9,7 +9,7 @@ import { Session } from '../../services/session';
import
{
ScrollService
}
from
'
../../services/ux/scroll
'
;
import
{
RecentService
}
from
'
../../services/ux/recent
'
;
import
{
MindsUser
}
from
'
../../interfaces/entities
'
;
import
{
ChannelMode
,
MindsUser
}
from
'
../../interfaces/entities
'
;
import
{
MindsChannelResponse
}
from
'
../../interfaces/responses
'
;
import
{
ContextService
}
from
'
../../services/context.service
'
;
import
{
FeaturesService
}
from
'
../../services/features.service
'
;
...
...
@@ -46,7 +46,14 @@ export class ChannelComponent {
@
ViewChild
(
'
feed
'
,
{
static
:
false
})
private
feed
:
ChannelSortedComponent
;
get
canView
()
{
return
this
.
permissions
.
canInteract
(
this
.
user
,
Flags
.
VIEW
);
if
(
this
.
features
.
has
(
'
permissions
'
))
{
return
this
.
permissions
.
canInteract
(
this
.
user
,
Flags
.
VIEW
);
}
return
(
this
.
user
.
mode
!==
ChannelMode
.
CLOSED
||
this
.
user
.
subscribed
||
this
.
user
.
guid
===
this
.
session
.
getLoggedInUser
().
guid
);
}
constructor
(
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/groups/profile/groups-settings-button.spec.ts
View file @
02d78072
...
...
@@ -21,7 +21,7 @@ import { overlayModalServiceMock } from '../../../../tests/overlay-modal-service
import
{
GroupsService
}
from
'
../groups-service
'
;
import
{
FeaturesService
}
from
'
../../../services/features.service
'
;
import
{
featuresServiceMock
}
from
'
../../../../tests/features-service-mock.spec
'
;
import
{
PermissionsService
}
from
'
../../../common/services/permissions.service
'
;
import
{
PermissionsService
}
from
'
../../../common/services/permissions
/permissions
.service
'
;
let
groupConfig
=
{
countMembers
:
Promise
.
resolve
(
1
),
...
...
This diff is collapsed.
Click to expand it.