-
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
Implement Raise Your Hand Feature #367
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
1728e02
Enable test_request_to_speak
mustafaboleken 9f4f120
Add mechanism to approve/reject raising hand
mustafaboleken 3f5c906
Merge branch 'main' into addRaiseYourHand
mustafaboleken 5ceed0f
Refactor the converting role mechanism
mustafaboleken 35a9bcc
Merge branch 'main' into addRaiseYourHand
mustafaboleken 7bbc89b
Merge branch 'main' into addRaiseYourHand
mustafaboleken 5ff9973
Fix failed tests
mustafaboleken e9f639a
Enable REACT_APP_FOOTER_PUBLISHER_REQUEST_BUTTON_VISIBILITY in prod
mustafaboleken 03ba111
Merge branch 'main' into addRaiseYourHand
mustafaboleken 5f20b21
Update AntMedia.js
mustafaboleken 07709a8
Update .env.production.webinar
mustafaboleken 8db4e4c
Merge branch 'main' into addRaiseYourHand
mustafaboleken a4f5c1e
Update asset-manifest.json
mustafaboleken d7083fa
Update service-worker.js
mustafaboleken d9cb24b
Merge branch 'main' into addRaiseYourHand
mustafaboleken c93fe52
Add unit tests
mustafaboleken 275e783
Add unit tests
mustafaboleken 76cec0f
Refactor unit tests
mustafaboleken fc091bc
Update AntMedia.test.js
mustafaboleken 245a38d
Update test codes
mustafaboleken b0ee726
Add unit test for PublisherRequestTab
mustafaboleken a227259
Update PublisherRequestTab.test.js
mustafaboleken a585191
Merge branch 'main' into addRaiseYourHand
mustafaboleken 127c321
Update AntMedia.test.js
mustafaboleken e966ea0
Update AntMedia.test.js
mustafaboleken bf4c03b
Add unit test codes
mustafaboleken 3ba5f04
Add test id into join forms
mustafaboleken 941c447
Refactor snackbar usage
mustafaboleken 7e96bbb
Fix failing tests
mustafaboleken 108ef99
Add test codes
mustafaboleken 8255bb0
Update rest_helper.py
mustafaboleken 6802972
Update .env.production.webinar
mustafaboleken 69caa55
Update .env.production
mustafaboleken db56be7
Update .env.production
mustafaboleken 14728c3
Merge branch 'main' into addRaiseYourHand
mustafaboleken 2c60763
Merge branch 'main' into addRaiseYourHand
mustafaboleken 35a74ee
Comment some tests
mustafaboleken 4e6f9b8
Comment test codes temporarily
mustafaboleken e60e649
Revert "Comment test codes temporarily"
mustafaboleken d1efebe
Revert "Comment some tests"
mustafaboleken 3b2cdb0
Reapply "Comment some tests"
mustafaboleken b11cdbc
Enable some tests
mustafaboleken 9bc75e3
Enable some test codes
mustafaboleken 9299249
Merge branch 'main' into addRaiseYourHand
mustafaboleken 77b98c8
Rename videoId to streamId
mustafaboleken 1680646
Refactor participant tab design
mustafaboleken da1fe13
Merge branch 'main' into addRaiseYourHand
mustafaboleken 6791ff3
Merge branch 'main' into addRaiseYourHand
mustafaboleken d4d3029
Merge branch 'main' into addRaiseYourHand
mustafaboleken 7a2a224
Merge branch 'main' into addRaiseYourHand
mustafaboleken 9b8f770
Add missing functions after merge from main
mustafaboleken 00ed391
Add createWebRTCAdaptor function
mustafaboleken 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 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 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 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 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 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 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 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,90 @@ | ||
// src/PublisherRequestTab.tet.js | ||
|
||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import PublisherRequestTab from "../../Components/PublisherRequestTab"; | ||
import theme from "../../styles/theme"; | ||
import {ThemeList} from "../../styles/themeList"; | ||
import {ThemeProvider} from "@mui/material"; | ||
|
||
// Mock the useContext hook | ||
jest.mock('react', () => ({ | ||
...jest.requireActual('react'), | ||
useContext: jest.fn(), | ||
})); | ||
|
||
|
||
describe('Publisher Request Tab Component', () => { | ||
|
||
beforeEach(() => { | ||
// Reset the mock implementation before each test | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
|
||
it('renders without crashing', () => { | ||
render( | ||
<ThemeProvider theme={theme(ThemeList.Green)}> | ||
<PublisherRequestTab | ||
approveBecomeSpeakerRequest={jest.fn()} | ||
rejectBecomeSpeakerRequest={jest.fn()} | ||
requestSpeakerList={["test1", "test2"]} | ||
publishStreamId={"test0"} | ||
/> | ||
</ThemeProvider> | ||
); | ||
}); | ||
|
||
it('renders the publisher request items', () => { | ||
const { getByText } = render( | ||
<ThemeProvider theme={theme(ThemeList.Green)}> | ||
<PublisherRequestTab | ||
approveBecomeSpeakerRequest={jest.fn()} | ||
rejectBecomeSpeakerRequest={jest.fn()} | ||
requestSpeakerList={["test1", "test2"]} | ||
publishStreamId={"test0"} | ||
/> | ||
</ThemeProvider> | ||
); | ||
|
||
expect(getByText('test1')).toBeInTheDocument(); | ||
expect(getByText('test2')).toBeInTheDocument(); | ||
}); | ||
|
||
it('calls the approveBecomeSpeakerRequest function when the allow button is clicked', () => { | ||
let mockApproveBecomeSpeakerRequest = jest.fn(); | ||
|
||
const { getByTestId } = render( | ||
<ThemeProvider theme={theme(ThemeList.Green)}> | ||
<PublisherRequestTab | ||
approveBecomeSpeakerRequest={mockApproveBecomeSpeakerRequest} | ||
rejectBecomeSpeakerRequest={jest.fn()} | ||
requestSpeakerList={["test1", "test2"]} | ||
publishStreamId={"test0"} | ||
/> | ||
</ThemeProvider> | ||
); | ||
|
||
getByTestId('approve-become-speaker-test1').click(); | ||
expect(mockApproveBecomeSpeakerRequest).toHaveBeenCalledWith('test1'); | ||
}); | ||
|
||
it('calls the rejectBecomeSpeakerRequest function when the deny button is clicked', () => { | ||
let mockRejectBecomeSpeakerRequest = jest.fn(); | ||
|
||
const { getByTestId } = render( | ||
<ThemeProvider theme={theme(ThemeList.Green)}> | ||
<PublisherRequestTab | ||
approveBecomeSpeakerRequest={jest.fn()} | ||
rejectBecomeSpeakerRequest={mockRejectBecomeSpeakerRequest} | ||
requestSpeakerList={["test1", "test2"]} | ||
publishStreamId={"test0"} | ||
/> | ||
</ThemeProvider> | ||
); | ||
|
||
getByTestId('reject-become-speaker-test1').click(); | ||
expect(mockRejectBecomeSpeakerRequest).toHaveBeenCalledWith('test1'); | ||
}); | ||
|
||
}); |
Oops, something went wrong.
Oops, something went wrong.
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 removal in approveBecomeSpeakerRequest method in Antmedia.js