-
Notifications
You must be signed in to change notification settings - Fork 294
feat: improved accessibility for Show/Hide Accordions #1811
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
Draft
filippovskii09
wants to merge
6
commits into
openedx:master
Choose a base branch
from
raccoongang:filippovskii/feat/transfer-accessibility-to-show/hide-accordions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+25
−4
Draft
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8746c9c
feat: improved accessibility for Show/Hide Accordions
vladislavkeblysh fbbe11d
feat: remove extra class and use heading from paragon
filippovskii09 65610f5
feat: improved accessibility for Show/Hide Accordions
vladislavkeblysh 6d83608
fix: refactor and fix errors
filippovskii09 f113616
fix: remove extra jsx file
filippovskii09 855d5ee
fix: remove extra code
filippovskii09 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| import React from 'react'; | ||
| import { render } from '@testing-library/react'; | ||
| import { useSelector } from 'react-redux'; | ||
| import LiveTab from './LiveTab'; | ||
|
|
||
| jest.mock('react-redux', () => ({ | ||
| useSelector: jest.fn(), | ||
| })); | ||
|
|
||
| describe('LiveTab', () => { | ||
| afterEach(() => { | ||
| jest.clearAllMocks(); | ||
| document.body.innerHTML = ''; | ||
| }); | ||
|
|
||
| it('renders iframe from liveModel using dangerouslySetInnerHTML', () => { | ||
| useSelector.mockImplementation((selector) => selector({ | ||
| courseHome: { courseId: 'course-v1:test+id+2024' }, | ||
| models: { | ||
| live: { | ||
| 'course-v1:test+id+2024': { | ||
| iframe: '<iframe id="lti-tab-embed" src="about:blank"></iframe>', | ||
| }, | ||
| }, | ||
| }, | ||
| })); | ||
|
|
||
| render(<LiveTab />); | ||
|
|
||
| const iframe = document.getElementById('lti-tab-embed'); | ||
| expect(iframe).toBeInTheDocument(); | ||
| expect(iframe.src).toBe('about:blank'); | ||
| }); | ||
|
|
||
| it('adds classes to iframe after mount', () => { | ||
| document.body.innerHTML = ` | ||
| <div id="live_tab"> | ||
| <iframe id="lti-tab-embed" class=""></iframe> | ||
| </div> | ||
| `; | ||
|
|
||
| useSelector.mockImplementation((selector) => selector({ | ||
| courseHome: { courseId: 'course-v1:test+id+2024' }, | ||
| models: { | ||
| live: { | ||
| 'course-v1:test+id+2024': { | ||
| iframe: '<iframe id="lti-tab-embed"></iframe>', | ||
| }, | ||
| }, | ||
| }, | ||
| })); | ||
|
|
||
| render(<LiveTab />); | ||
|
|
||
| const iframe = document.getElementById('lti-tab-embed'); | ||
| expect(iframe.className).toContain('vh-100'); | ||
| expect(iframe.className).toContain('w-100'); | ||
| expect(iframe.className).toContain('border-0'); | ||
| }); | ||
|
|
||
| it('does not throw if iframe is not found in DOM', () => { | ||
| useSelector.mockImplementation((selector) => selector({ | ||
| courseHome: { courseId: 'course-v1:test+id+2024' }, | ||
| models: { | ||
| live: { | ||
| 'course-v1:test+id+2024': { | ||
| iframe: '<div>No iframe here</div>', | ||
| }, | ||
| }, | ||
| }, | ||
| })); | ||
|
|
||
| expect(() => render(<LiveTab />)).not.toThrow(); | ||
| const iframe = document.getElementById('lti-tab-embed'); | ||
| expect(iframe).toBeNull(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -436,12 +436,12 @@ | |
| .course-outline-tab .pgn__card { | ||
| .pgn__card-header { | ||
| display: block; | ||
|
|
||
| .pgn__card-header-content { | ||
| margin-top: 0; | ||
| } | ||
| } | ||
|
|
||
| .pgn__card-header-actions { | ||
| margin-left: 0; | ||
| } | ||
|
|
@@ -456,6 +456,7 @@ | |
| @import "courseware/course/content-tools/calculator/calculator.scss"; | ||
| @import "courseware/course/content-tools/contentTools.scss"; | ||
| @import "course-home/dates-tab/timeline/Day.scss"; | ||
| @import "generic/upsell-bullets/UpsellBullets.scss"; | ||
|
||
| @import "course-home/outline-tab/widgets/ProctoringInfoPanel.scss"; | ||
| @import "course-home/outline-tab/widgets/FlagButton.scss"; | ||
| @import "course-home/progress-tab/course-completion/CompletionDonutChart.scss"; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we need this tests?
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.
was deleted