Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LINAGORA
L
LGS
Labs
hublot
Commits
95196bad
Commit
95196bad
authored
Oct 24, 2017
by
Yoann HOUPERT
Browse files
clean code from PR comment
parent
22e41c18
Pipeline
#4169
passed with stage
in 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
client/robot/robot.js
client/robot/robot.js
+4
-6
client/robot/robot.test.js
client/robot/robot.test.js
+11
-9
No files found.
client/robot/robot.js
View file @
95196bad
...
...
@@ -140,12 +140,10 @@ robot = {
const
keyMap
=
Object
.
keys
(
robot
.
recordedParticipantsWS
);
if
(
keyMap
)
{
for
(
let
i
=
0
;
i
<
keyMap
.
length
;
i
++
)
{
if
(
keyMap
[
i
])
{
try
{
robot
.
stopRecordParticipant
(
keyMap
[
i
]);
}
catch
(
err
)
{
console
.
log
(
'
This user is innactive
'
);
}
try
{
robot
.
stopRecordParticipant
(
keyMap
[
i
]);
}
catch
(
err
)
{
console
.
log
(
'
This user is inactive
'
);
}
}
}
...
...
client/robot/robot.test.js
View file @
95196bad
...
...
@@ -188,10 +188,6 @@ describe('client/robot', () => {
/* eslint-enable */
});
test
(
'
should set a interval for disconnection
'
,
()
=>
{
expect
.
arrayContaining
([[
global
.
robot
.
checkDisconnect
,
300000
]]);
});
test
(
'
should not record itself
'
,
()
=>
{
expect
(
global
.
MediaRecorder
.
instances
)
.
not
.
toHaveProperty
(
global
.
robotController
.
getMyId
());
...
...
@@ -216,9 +212,12 @@ describe('client/robot', () => {
expect
(
sttMock
.
sttDataSent
[
sttMock
.
sttDataSent
.
length
-
1
]).
toBe
(
e
.
data
);
});
test
(
'
should participant be on
'
,
()
=>
{
expect
(
global
.
robot
.
participantsMediaRecorders
.
someid1
.
stopped
).
toBe
(
false
);
expect
(
global
.
robot
.
recordedParticipantsWS
.
someid1
.
status
).
toBe
(
'
open
'
);
test
(
'
should record and transcribe active participants
'
,
()
=>
{
const
keyMap
=
Object
.
keys
(
global
.
robot
.
participantsMediaRecorders
);
for
(
let
i
=
0
;
i
<
keyMap
.
length
;
i
++
)
{
expect
(
global
.
robot
.
participantsMediaRecorders
[
keyMap
[
i
]].
stopped
).
toBeFalsy
();
expect
(
global
.
robot
.
recordedParticipantsWS
[
keyMap
[
i
]].
status
).
toBe
(
'
open
'
);
}
});
test
(
'
should stop transcribing stream on user disconnect
'
,
()
=>
{
...
...
@@ -256,8 +255,11 @@ describe('client/robot', () => {
test
(
'
should clear the connection
'
,
()
=>
{
global
.
robot
.
clearConnection
();
expect
(
global
.
robot
.
participantsMediaRecorders
.
someid1
.
stopped
).
toBe
(
true
);
expect
(
global
.
robot
.
recordedParticipantsWS
.
someid1
.
status
).
toBe
(
'
closed
'
);
const
keyMap
=
Object
.
keys
(
global
.
robot
.
participantsMediaRecorders
);
for
(
let
i
=
0
;
i
<
keyMap
.
length
;
i
++
)
{
expect
(
global
.
robot
.
participantsMediaRecorders
[
keyMap
[
i
]].
stopped
).
toBeTruthy
();
expect
(
global
.
robot
.
recordedParticipantsWS
[
keyMap
[
i
]].
status
).
toBe
(
'
closed
'
);
}
expect
(
global
.
robot
.
intervalList
.
length
).
toBe
(
0
);
});
...
...
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