Skip to content

Commit

Permalink
Add unit test codes
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaboleken committed Jan 5, 2025
1 parent 4e60f37 commit 58d4646
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// src/RoomCreationPasswordDialog.test.js
import React from 'react';
import { render } from '@testing-library/react';
import {RoomCreationPasswordDialog} from "../../../../Components/Footer/Components/RoomCreationPasswordDialog";

// Mock the useContext hook
jest.mock('react', () => ({
...jest.requireActual('react'),
}));

describe('Room Creation Password Dialog Component', () => {

beforeEach(() => {
// Reset the mock implementation before each test
jest.clearAllMocks();
});


it('renders without crashing', () => {
render(
<RoomCreationPasswordDialog
onClose={jest.fn()}
password={"pasword"}
onPasswordChange={jest.fn()}
open={true}
onCreateRoomClicked={jest.fn()}
/>
);
});

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// src/ShareScreenButton.test.js
import React from 'react';
import { render } from '@testing-library/react';
import ShareScreenButton from "../../../../Components/Footer/Components/ShareScreenButton";

// Mock the useContext hook
jest.mock('react', () => ({
...jest.requireActual('react'),
}));

describe('Share Screen Button Component', () => {

beforeEach(() => {
// Reset the mock implementation before each test
jest.clearAllMocks();
});


it('renders without crashing', () => {
render(
<ShareScreenButton
footer={true}
isScreenShared={false}
handleStartScreenShare={jest.fn()}
handleStopScreenShare={jest.fn()}
/>
);
});

});

0 comments on commit 58d4646

Please sign in to comment.