Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/discussions/in-context-topics/TopicPostsView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
/>
)}
<div className="border-bottom border-light-400" />
<div className="list-group list-group-flush flex-fill" role="list" onKeyDown={e => handleKeyDown(e)}>
<ul className="list-group list-group-flush flex-fill" data-testid="list" onKeyDown={e => handleKeyDown(e)}>

Check warning on line 78 in src/discussions/in-context-topics/TopicPostsView.jsx

View check run for this annotation

Codecov / codecov/patch

src/discussions/in-context-topics/TopicPostsView.jsx#L78

Added line #L78 was not covered by tests
{topicId ? (
<PostsList
postsIds={postsIds}
Expand All @@ -94,11 +94,11 @@
<NoResults />
)}
{(category && topicsInProgress) && (
<div className="d-flex justify-content-center p-4">
<li className="d-flex justify-content-center p-4">
<Spinner animation="border" variant="primary" size="lg" />
</div>
</li>
)}
</div>
</ul>
</div>
);
};
Expand Down
6 changes: 3 additions & 3 deletions src/discussions/in-context-topics/TopicsView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ const TopicsView = () => {
{filteredTopics.length === 0 && loadingStatus === RequestStatus.SUCCESSFUL && <NoResults />}
</>
)}
<div
<ul
className={classNames('list-group list-group-flush flex-fill', {
'justify-content-center': loadingStatus === RequestStatus.IN_PROGRESS && isEmpty(topics),
})}
role="list"
data-testid="list"
onKeyDown={e => handleKeyDown(e)}
>
{topicFilter ? (
Expand All @@ -126,7 +126,7 @@ const TopicsView = () => {
) : (
<TopicsList />
)}
</div>
</ul>
</div>
);
};
Expand Down
8 changes: 4 additions & 4 deletions src/discussions/in-context-topics/TopicsView.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ describe('InContext Topics View', () => {
it('Section groups should be listed in the middle of the topics list.', async () => {
await setupMockResponse();
renderComponent();
const topicsList = await screen.getByRole('list');
const topicsList = await screen.getByTestId('list');
const sectionGroups = await screen.getAllByTestId('section-group');

expect(topicsList.children[1]).toStrictEqual(topicsList.querySelector('.divider'));
expect(topicsList.children[1].querySelector('.divider')).toStrictEqual(topicsList.querySelector('.divider'));
expect(sectionGroups.length).toBe(2);
expect(topicsList.children[5]).toStrictEqual(topicsList.querySelector('.divider'));
expect(topicsList.children[3].querySelector('.divider')).toStrictEqual(topicsList.querySelector('.divider'));
});

it('A section group should have only a title and required subsections.', async () => {
Expand Down Expand Up @@ -187,7 +187,7 @@ describe('InContext Topics View', () => {
await userEvent.click(subSection);
await waitFor(async () => {
const backButton = await screen.getByLabelText('Back to topics list');
const topicsList = await screen.getByRole('list');
const topicsList = await screen.getByTestId('list');
const subSectionHeading = await screen.findByText(subsectionObject.displayName);
const units = await topicsList.querySelectorAll('.discussion-topic');

Expand Down
4 changes: 2 additions & 2 deletions src/discussions/in-context-topics/topic/ArchivedBaseGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ArchivedBaseGroup = ({
), [archivedTopics]);

return (
<>
<li>
{showDivider && (
<>
<div className="divider border-top border-light-500" />
Expand All @@ -37,7 +37,7 @@ const ArchivedBaseGroup = ({
<div className="pt-3 px-4 font-weight-bold">{intl.formatMessage(messages.archivedTopics)}</div>
{renderArchivedTopics}
</div>
</>
</li>
);
};

Expand Down
4 changes: 2 additions & 2 deletions src/discussions/in-context-topics/topic/SectionBaseGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const SectionBaseGroup = ({
), [section, sectionUrl, isSelected]);

return (
<div
<li
className="discussion-topic-group d-flex flex-column text-primary-500"
data-section-id={sectionId}
data-testid="section-group"
Expand All @@ -75,7 +75,7 @@ const SectionBaseGroup = ({
<div className="divider pt-1 bg-light-300" />
</>
)}
</div>
</li>
);
};

Expand Down
4 changes: 2 additions & 2 deletions src/discussions/in-context-topics/topic/Topic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Topic = ({
});

return (
<>
<li>
<Link
className={classNames('discussion-topic p-0 text-decoration-none text-primary-500', {
'border-light-400 border-bottom': showDivider,
Expand Down Expand Up @@ -54,7 +54,7 @@ const Topic = ({
<div className="divider pt-1 bg-light-300" />
</>
)}
</>
</li>
);
};

Expand Down
4 changes: 2 additions & 2 deletions src/discussions/learners/LearnersView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const LearnersView = () => {
onClear={handleOnClear}
/>
)}
<div className="list-group list-group-flush learner" role="list">
<ul className="list-group list-group-flush learner" data-testid="list">
{renderLearnersList}
{loadingStatus === RequestStatus.IN_PROGRESS ? (
<div className="d-flex justify-content-center p-4">
Expand All @@ -90,7 +90,7 @@ const LearnersView = () => {
)
)}
{ usernameSearch !== '' && learners.length === 0 && loadingStatus === RequestStatus.SUCCESSFUL && <NoResults />}
</div>
</ul>
</div>
);
};
Expand Down
62 changes: 32 additions & 30 deletions src/discussions/learners/learner/LearnerCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,43 @@ const LearnerCard = ({ learner }) => {
})();

return (
<Link
className="discussion-post p-0 text-decoration-none text-gray-900 border-bottom border-light-400"
to={linkUrl}
>
<div
className="d-flex flex-row flex-fill mw-100 py-3 px-4 border-primary-500"
style={username === learnerUsername ? {
borderRightWidth: '4px',
borderRightStyle: 'solid',
} : null}
<li>
<Link
className="discussion-post p-0 text-decoration-none text-gray-900 border-bottom border-light-400"
to={linkUrl}
>
<LearnerAvatar username={username} />
<div className="d-flex flex-column flex-fill" style={{ minWidth: 0 }}>
<div className="d-flex flex-column justify-content-start mw-100 flex-fill">
<div className="d-flex align-items-center flex-fill">
<div
className="text-truncate font-weight-500 text-primary-500 font-style"
>
{username}
<div
className="d-flex flex-row flex-fill mw-100 py-3 px-4 border-primary-500"
style={username === learnerUsername ? {
borderRightWidth: '4px',
borderRightStyle: 'solid',
} : null}
>
<LearnerAvatar username={username} />
<div className="d-flex flex-column flex-fill" style={{ minWidth: 0 }}>
<div className="d-flex flex-column justify-content-start mw-100 flex-fill">
<div className="d-flex align-items-center flex-fill">
<div
className="text-truncate font-weight-500 text-primary-500 font-style"
>
{username}
</div>
</div>
{threads !== null && (
<LearnerFooter
inactiveFlags={inactiveFlags}
activeFlags={activeFlags}
threads={threads}
responses={responses}
replies={replies}
username={username}
/>
)}
</div>
{threads !== null && (
<LearnerFooter
inactiveFlags={inactiveFlags}
activeFlags={activeFlags}
threads={threads}
responses={responses}
replies={replies}
username={username}
/>
)}
</div>
</div>
</div>
</Link>
</Link>
</li>
);
};

Expand Down
4 changes: 2 additions & 2 deletions src/discussions/posts/PostsView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@
)}
<PostFilterBar />
<div className="border-bottom border-light-400" />
<div className="list-group list-group-flush flex-fill" role="list" onKeyDown={e => handleKeyDown(e)}>
<ul className="list-group list-group-flush flex-fill" data-testid="list" onKeyDown={e => handleKeyDown(e)}>

Check warning on line 103 in src/discussions/posts/PostsView.jsx

View check run for this annotation

Codecov / codecov/patch

src/discussions/posts/PostsView.jsx#L103

Added line #L103 was not covered by tests
{postsListComponent}
</div>
</ul>
</div>
);
};
Expand Down
Loading