-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Add accept privacy to the about dialog (#437)
- Loading branch information
1 parent
14665d2
commit 854c3a8
Showing
8 changed files
with
186 additions
and
109 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react' | ||
import {render, fireEvent} from '@testing-library/react' | ||
import * as Privacy from '../privacy/Privacy' | ||
import {MockComponent} from '../__mocks__/MockComponent' | ||
import AboutControl from './AboutControl' | ||
import {setPrivacy} from './AboutControl' | ||
|
||
|
||
describe('About control tests', () => { | ||
test('renders the AboutControl button', () => { | ||
const {getByTitle} = render(<MockComponent><AboutControl/></MockComponent>) | ||
const aboutControl = getByTitle('About BLDRS') | ||
expect(aboutControl).toBeInTheDocument() | ||
}) | ||
|
||
test('renders AbotDialog when control is pressed', () => { | ||
const {getByTitle, getByText} = render(<MockComponent><AboutControl/></MockComponent>) | ||
const aboutControl = getByTitle('About BLDRS') | ||
fireEvent.click(aboutControl) | ||
const dialogTitle = getByText('Build Every Thing Together') | ||
expect(dialogTitle).toBeInTheDocument() | ||
}) | ||
|
||
test('sets privacy settings correctly', () => { | ||
// Test setting privacy to disabled | ||
setPrivacy(true) | ||
expect(Privacy.isPrivacySocialEnabled()).toBe(false) | ||
// Test setting privacy to enabled | ||
setPrivacy(false) | ||
expect(Privacy.isPrivacySocialEnabled()).toBe(true) | ||
}) | ||
}) |
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
Oops, something went wrong.