-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial set of player tests #340
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this as we have actual tests now
87688a6
to
c95599c
Compare
c95599c
to
f1dc4cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. One small structural suggestion.
spec.describe('calling player API when a source is loaded', () => { | ||
spec.it( | ||
'emits a Play and Playing events after calling play API', | ||
async () => { | ||
await startPlayerTest({}, async () => { | ||
await loadSourceConfig(Sources.artOfMotionHls); | ||
await callPlayerAndExpectEvents((player) => { | ||
player.play(); | ||
}, EventSequence(EventType.Play, EventType.Playing)); | ||
}); | ||
} | ||
); | ||
spec.it('emits a Paused event after calling pause API', async () => { | ||
await startPlayerTest({}, async () => { | ||
await loadSourceConfig(Sources.artOfMotionHls); | ||
await playFor(1); | ||
await callPlayerAndExpectEvent((player) => { | ||
player.pause(); | ||
}, EventType.Paused); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be two separate blocks I think.
spec.describe('calling player API when a source is loaded', () => { | |
spec.it( | |
'emits a Play and Playing events after calling play API', | |
async () => { | |
await startPlayerTest({}, async () => { | |
await loadSourceConfig(Sources.artOfMotionHls); | |
await callPlayerAndExpectEvents((player) => { | |
player.play(); | |
}, EventSequence(EventType.Play, EventType.Playing)); | |
}); | |
} | |
); | |
spec.it('emits a Paused event after calling pause API', async () => { | |
await startPlayerTest({}, async () => { | |
await loadSourceConfig(Sources.artOfMotionHls); | |
await playFor(1); | |
await callPlayerAndExpectEvent((player) => { | |
player.pause(); | |
}, EventType.Paused); | |
}); | |
}); | |
}); | |
spec.describe('calling play when a source is loaded', () => { | |
spec.it( | |
'emits a Play and Playing events', | |
async () => { | |
await startPlayerTest({}, async () => { | |
await loadSourceConfig(Sources.artOfMotionHls); | |
await callPlayerAndExpectEvents((player) => { | |
player.play(); | |
}, EventSequence(EventType.Play, EventType.Playing)); | |
}); | |
} | |
); | |
}); | |
spec.describe('calling pause when a source is loaded', () => { | |
spec.it('emits a Paused event', async () => { | |
await startPlayerTest({}, async () => { | |
await loadSourceConfig(Sources.artOfMotionHls); | |
await playFor(1); | |
await callPlayerAndExpectEvent((player) => { | |
player.pause(); | |
}, EventType.Paused); | |
}); | |
}); | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied feedback in 118b30c
Description
We have no meaningful tests for player behavior.
Changes
Added 11 tests for basic player behavior testing.
Checklist
CHANGELOG
entry - not applicable