Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Frontend
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
383
Merge Requests
66
CI / CD
Security & Compliance
Packages
Analytics
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Compare Revisions
5f7cd47d121e3a5af73769d998ee2466418f0639...2c98c6a622ae9d270d24ca70ced805b5d70ac0cd
Source
2c98c6a622ae9d270d24ca70ced805b5d70ac0cd
...
Target
5f7cd47d121e3a5af73769d998ee2466418f0639
Compare
Commits (2)
Reverting package.json
· 6aa592e8
Ben Hayward
authored
58 minutes ago
6aa592e8
Fixed spec tests
· 2c98c6a6
Ben Hayward
authored
47 minutes ago
2c98c6a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
15 deletions
+49
-15
package.json
View file @
2c98c6a6
...
...
@@ -12,9 +12,7 @@
"build-dev"
:
"npm run build:dev"
,
"serve-dev"
:
"npm run server:ssr"
,
"build:dev"
:
"ng build --output-path dist --deploy-url=/ --watch=true --poll=800"
,
"preserve:dev"
:
"npm run prebuild-dev -- --deploy-url=http://${HOST:-localhost}:${PORT:-4200}"
,
"serve:dev"
:
"ng serve --deploy-url=/ --port ${PORT:-4200} --poll=800 --progress --proxy-config proxy.conf.js --host=0.0.0.0 --disableHostCheck=true"
,
"serve:dev:hmr"
:
"npm run serve:dev -- --configuration=hmr --hmr"
,
"serve:dev"
:
"ng serve --host=0.0.0.0 --deploy-url=/ --configuration=hmr --hmr --poll=800 --progress --disableHostCheck=true"
,
"test"
:
"ng test"
,
"lint"
:
"ng lint"
,
"e2e"
:
"cypress run --debug"
,
...
...
This diff is collapsed.
src/app/common/components/explicit-overlay/overlay.component.spec.ts
View file @
2c98c6a6
...
...
@@ -5,7 +5,7 @@ import { sessionMock } from '../../../../tests/session-mock.spec';
import
{
Storage
}
from
'
../../../services/storage
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
storageMock
}
from
'
../../../../tests/storage-mock.spec
'
;
import
{
ConfigsService
}
from
'
../../
../common/
services/configs.service
'
;
import
{
ConfigsService
}
from
'
../../services/configs.service
'
;
import
{
MockService
}
from
'
../../../utils/mock
'
;
let
routerMock
=
new
(
function
()
{
...
...
@@ -55,7 +55,7 @@ describe('OverlayComponent', () => {
});
it
(
'
should not show overlay when mature visibility is set
'
,
()
=>
{
comp
.
channel
=
{
comp
.
entity
=
{
mature_visibility
:
true
,
};
comp
.
showOverlay
();
...
...
@@ -63,8 +63,8 @@ describe('OverlayComponent', () => {
expect
(
comp
.
hidden
).
toBeTruthy
();
});
it
(
'
should overlay when
channel
is mature
'
,
()
=>
{
comp
.
_
channel
=
{
it
(
'
should overlay when
entity
is mature
'
,
()
=>
{
comp
.
_
entity
=
{
is_mature
:
true
,
};
comp
.
showOverlay
();
...
...
@@ -72,8 +72,8 @@ describe('OverlayComponent', () => {
expect
(
comp
.
hidden
).
toBeFalsy
();
});
it
(
'
should overlay when
channel
is nsfw for one reason
'
,
()
=>
{
comp
.
_
channel
=
{
it
(
'
should overlay when
entity
is nsfw for one reason
'
,
()
=>
{
comp
.
_
entity
=
{
nsfw
:
[
1
],
};
comp
.
showOverlay
();
...
...
@@ -81,8 +81,8 @@ describe('OverlayComponent', () => {
expect
(
comp
.
hidden
).
toBeFalsy
();
});
it
(
'
should overlay when
channel
is nsfw for multiple reason
'
,
()
=>
{
comp
.
_
channel
=
{
it
(
'
should overlay when
entity
is nsfw for multiple reason
'
,
()
=>
{
comp
.
_
entity
=
{
nsfw
:
[
1
,
2
,
3
],
};
comp
.
showOverlay
();
...
...
@@ -90,8 +90,44 @@ describe('OverlayComponent', () => {
expect
(
comp
.
hidden
).
toBeFalsy
();
});
it
(
'
should overlay not show overlay if channel is not nsfw, mature and no mature_visibility
'
,
()
=>
{
comp
.
_channel
=
{
it
(
'
should overlay when entity has nsfw_lock for one reason
'
,
()
=>
{
comp
.
_entity
=
{
nsfw_lock
:
[
1
],
};
comp
.
showOverlay
();
fixture
.
detectChanges
();
expect
(
comp
.
hidden
).
toBeFalsy
();
});
it
(
'
should overlay when entity has nsfw_lock for multiple reasons
'
,
()
=>
{
comp
.
_entity
=
{
nsfw_lock
:
[
1
,
2
,
3
],
};
comp
.
showOverlay
();
fixture
.
detectChanges
();
expect
(
comp
.
hidden
).
toBeFalsy
();
});
it
(
'
should have type `channel` when entity is a user
'
,
()
=>
{
comp
.
entity
=
{
type
:
'
user
'
,
};
comp
.
showOverlay
();
fixture
.
detectChanges
();
expect
(
comp
.
type
).
toBe
(
'
channel
'
);
});
it
(
'
should have type `group` when entity is a group
'
,
()
=>
{
comp
.
entity
=
{
type
:
'
group
'
,
};
comp
.
showOverlay
();
fixture
.
detectChanges
();
expect
(
comp
.
type
).
toBe
(
'
group
'
);
});
it
(
'
should overlay not show overlay if entity is not nsfw, mature and no mature_visibility
'
,
()
=>
{
comp
.
_entity
=
{
mature_visibility
:
false
,
is_mature
:
false
,
nsfw
:
[],
...
...
@@ -102,7 +138,7 @@ describe('OverlayComponent', () => {
});
it
(
'
should not register undefined values as a false positive, and show the overlay
'
,
()
=>
{
comp
.
_
channel
=
{
comp
.
_
entity
=
{
mature_visibility
:
undefined
,
is_mature
:
undefined
,
nsfw
:
undefined
,
...
...
This diff is collapsed.
src/app/common/components/explicit-overlay/overlay.component.ts
View file @
2c98c6a6
...
...
@@ -12,7 +12,7 @@ export class ExplicitOverlayComponent {
readonly
siteUrl
:
string
;
public
hidden
=
true
;
public
_entity
:
any
;
p
rotected
type
:
string
;
p
ublic
type
:
string
;
@
Input
()
set
entity
(
value
:
any
)
{
if
(
value
)
{
...
...
This diff is collapsed.