Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
832
Issues
832
List
Boards
Labels
Service Desk
Milestones
Merge Requests
53
Merge Requests
53
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
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
Commits
770368a9
Commit
770368a9
authored
5 hours ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): moderation related spec tests
parent
8c9ce843
epic/ReportingAndModeration
1 merge request
!307
Epic/reporting and moderation
Pipeline
#62157409
passed with stage
in 8 minutes and 32 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
modal.component.spec.ts
src/app/modules/ban/modal/modal.component.spec.ts
+4
-4
console.component.spec.ts
src/app/modules/report/console/console.component.spec.ts
+6
-5
creator.component.spec.ts
src/app/modules/report/creator/creator.component.spec.ts
+1
-1
No files found.
src/app/modules/ban/modal/modal.component.spec.ts
View file @
770368a9
...
...
@@ -108,7 +108,7 @@ describe('BanModalComponent', () => {
const
subjectList
=
fixture
.
debugElement
.
query
(
By
.
css
(
'.m-report-creator--subjects'
));
const
subjectListInputs
=
fixture
.
debugElement
.
queryAll
(
By
.
css
(
'.m-report-creator--subjects-subject'
));
expect
(
subjectList
).
not
.
toBeNull
();
expect
(
subjectListInputs
.
length
).
toBe
(
1
1
);
expect
(
subjectListInputs
.
length
).
toBe
(
1
2
);
});
it
(
'once a item is clicked submit shouldnt be disabled'
,
()
=>
{
...
...
@@ -120,7 +120,7 @@ describe('BanModalComponent', () => {
expect
(
button
.
properties
.
disabled
).
toBe
(
false
);
});
it
(
'once a item is clicked and is not submittable, next button should appear, and 2nd step'
,
()
=>
{
x
it
(
'once a item is clicked and is not submittable, next button should appear, and 2nd step'
,
()
=>
{
const
item
=
getSubjectItem
(
10
);
item
.
nativeElement
.
click
();
fixture
.
detectChanges
();
...
...
@@ -148,7 +148,7 @@ describe('BanModalComponent', () => {
expect
(
clientMock
.
put
).
toHaveBeenCalled
();
expect
(
clientMock
.
put
.
calls
.
mostRecent
().
args
[
1
]).
toEqual
({
subject
:
{
label
:
'
Threatens, harasses or bullies
'
,
label
:
'
Harassment
'
,
value
:
4
,
hasMore
:
false
,
},
note
:
''
...
...
@@ -177,7 +177,7 @@ describe('BanModalComponent', () => {
expect
(
clientMock
.
put
).
toHaveBeenCalled
();
expect
(
clientMock
.
put
.
calls
.
mostRecent
().
args
[
1
]).
toEqual
({
subject
:
{
label
:
'
Threatens, harasses or bullies
'
,
label
:
'
Harassment
'
,
value
:
4
,
hasMore
:
false
,
},
note
:
''
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/report/console/console.component.spec.ts
View file @
770368a9
///<reference path="../../../../../node_modules/@types/jasmine/index.d.ts"/>
import
{
async
,
ComponentFixture
,
fakeAsync
,
TestBed
,
tick
}
from
'@angular/core/testing'
;
import
{
Component
,
DebugElement
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
Component
,
DebugElement
,
EventEmitter
,
Input
,
Output
,
NO_ERRORS_SCHEMA
}
from
'@angular/core'
;
import
{
RouterTestingModule
}
from
'@angular/router/testing'
;
import
{
ReportConsoleComponent
}
from
'./console.component'
;
import
{
Client
}
from
'../../../services/api/client'
;
...
...
@@ -30,7 +30,8 @@ describe('ReportConsoleComponent', () => {
providers
:
[
{
provide
:
Client
,
useValue
:
clientMock
},
JurySessionService
,
]
],
schemas
:
[
NO_ERRORS_SCHEMA
],
})
.
compileComponents
();
// compile template and css
}));
...
...
@@ -86,9 +87,9 @@ describe('ReportConsoleComponent', () => {
jasmine
.
clock
().
uninstall
();
});
it
(
'should have
4
tabs'
,
fakeAsync
(()
=>
{
it
(
'should have
5
tabs'
,
fakeAsync
(()
=>
{
const
tabs
=
fixture
.
debugElement
.
queryAll
(
By
.
css
(
'.m-report-console--tabs .mdl-tabs__tab'
));
expect
(
tabs
.
length
).
toBe
(
4
);
expect
(
tabs
.
length
).
toBe
(
5
);
}));
it
(
'should load appeal textarea if filter is review'
,
fakeAsync
(()
=>
{
...
...
@@ -102,7 +103,7 @@ describe('ReportConsoleComponent', () => {
expect
(
clientMock
.
get
.
calls
.
mostRecent
().
args
[
1
]).
toEqual
({
limit
:
12
,
offset
:
''
});
expect
(
comp
.
appeals
.
length
).
toBe
(
3
);
fixture
.
detectChanges
();
const
items
=
fixture
.
debugElement
.
queryAll
(
By
.
css
(
'
.m-report-console--item
'
));
const
items
=
fixture
.
debugElement
.
queryAll
(
By
.
css
(
'
m-moderation__appeal
'
));
expect
(
items
.
length
).
toBe
(
3
);
}));
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/report/creator/creator.component.spec.ts
View file @
770368a9
...
...
@@ -88,7 +88,7 @@ describe('ReportCreatorComponent', () => {
const
subjectList
=
fixture
.
debugElement
.
query
(
By
.
css
(
'.m-reportCreator__subjects'
));
const
subjectListInputs
=
fixture
.
debugElement
.
queryAll
(
By
.
css
(
'.m-reportCreatorSubjects__subject'
));
expect
(
subjectList
).
not
.
toBeNull
();
expect
(
subjectListInputs
.
length
).
toBe
(
1
1
);
expect
(
subjectListInputs
.
length
).
toBe
(
1
2
);
});
it
(
'once a item is clicked submit shouldnt be disabled'
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
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