This repository has been archived by the owner on Jun 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3f84bd
commit 0e61fea
Showing
2 changed files
with
39 additions
and
4 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,35 @@ | ||
/* global describe, it */ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import 'mocha' | ||
import * as React from 'react' | ||
import * as assert from 'assert' | ||
import ShieldsSecurityControls, { Props } from '../../../../app/components/braveShields/securityControls' | ||
import { shallow } from 'enzyme' | ||
|
||
const fakeProps: Props = { | ||
braveShields: 'allow', | ||
httpsRedirected: 0 | ||
} | ||
|
||
describe('SecurityControls component', () => { | ||
const baseComponent = (props: Props) => | ||
<ShieldsSecurityControls {...props} /> | ||
|
||
it('renders the component', () => { | ||
const wrapper = shallow(baseComponent(fakeProps)) | ||
const assertion = wrapper.find('#braveShieldsSecurityControls').length === 1 | ||
assert.equal(assertion, true) | ||
}) | ||
|
||
describe('https everywhere', () => { | ||
it('shows number of https redirected', () => { | ||
const newProps = Object.assign(fakeProps, { httpsRedirected: 1337 }) | ||
const wrapper = shallow(baseComponent(newProps)) | ||
const assertion = wrapper.find('#httpsRedirectedStat').props().children | ||
assert.equal(assertion, 1337) | ||
}) | ||
}) | ||
}) |