Skip to content

Commit

Permalink
fix: Hide skills section on video detail page and some nits
Browse files Browse the repository at this point in the history
  • Loading branch information
Maham Akif authored and Maham Akif committed Jul 31, 2024
1 parent 7981e83 commit 1eb9de9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
24 changes: 15 additions & 9 deletions src/components/microlearning/VideoDetailPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,25 @@ const VideoDetailPage = () => {
<Row>
<article className="col-12 col-lg-9">
<div className="d-flex flex-column align-items-start flex-grow-1 video-container">
<div className="d-flex flex-row align-items-center justify-content-between">
<h2 data-testid="video-title" className="mb-0">
{videoData?.courseTitle}
</h2>
<span className="small ml-2 mt-2 text-nowrap">
{videoData?.videoDuration && `(${videoData?.videoDuration} minutes)`}
</span>
</div>
{ videoData?.courseTitle && (
<div className="d-flex flex-row align-items-start justify-content-between">
<div className="flex-grow-1">
<h2 data-testid="video-title" className="mb-0 text-wrap">
{videoData?.courseTitle}
</h2>
</div>
<span className="small ml-2 mt-2 text-nowrap">
{videoData?.videoDuration && `(${videoData?.videoDuration} minutes)`}
</span>
</div>
)}
<p className="small align-self-stretch p-0 mb-0">
{videoData?.videoSummary}
</p>
{/* Skills that we are currently retrieving for videos are inaccurate, so we are temporarily
hiding this section. */}
{videoData?.videoSkills?.length > 0 && (
<div className="d-flex flex-row align-items-center">
<div className="d-none flex-row align-items-center">
<h4 className="mb-0">
<FormattedMessage
id="videoDetailPage.skills.label"
Expand Down
6 changes: 4 additions & 2 deletions src/components/microlearning/tests/VideoDetailPage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ describe('VideoDetailPage Tests', () => {
expect(screen.getByTestId('video-title')).toHaveTextContent('Test Video');
expect(screen.getByText('(10:4 minutes)')).toBeInTheDocument();
expect(screen.getByText('This is a test video summary.')).toBeInTheDocument();
expect(screen.getByText('Skill 1')).toBeInTheDocument();
expect(screen.getByText('Skill 2')).toBeInTheDocument();
// Skills that we are currently retrieving for videos are inaccurate, so we are

Check failure on line 109 in src/components/microlearning/tests/VideoDetailPage.test.jsx

View workflow job for this annotation

GitHub Actions / tests

Trailing spaces not allowed
// temporarily hiding this section.
// expect(screen.getByText('Skill 1')).toBeInTheDocument();
// expect(screen.getByText('Skill 2')).toBeInTheDocument();
expect(container.querySelector('.video-player-wrapper')).toBeTruthy();
});
it('renders a video detail page when course level type is Intermediate', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/video/VideoPlayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import VideoJS from './VideoJS';

const hlsExtension = '.m3u8';
const defaultOptions = {
autoplay: true,
autoplay: false,
controls: true,
responsive: true,
fluid: true,
Expand Down

0 comments on commit 1eb9de9

Please sign in to comment.