Skip to content
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.

Commit

Permalink
add braveShiedsStats test for duplicated ads+trackers blocked resources
Browse files Browse the repository at this point in the history
  • Loading branch information
cezaraugusto committed Jul 2, 2018
1 parent 7bfc047 commit 4bbe39c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/app/components/braveShields/braveShieldsStatsTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,26 @@ describe('BraveShieldsStats component', () => {

assert.equal(assertion2, true)
})

it('properly merges ads + trackers in the same list without duplicates', () => {
const componentId = 'totalAdsTrackersBlockedStat'
const target = { target: { id: componentId } }
const newProps = Object.assign(fakeProps, {
adsBlockedResources: [
'https://everbodys-got-something-to-hide-except-me-and-my-monkey.cool',
'https://everbodys-got-something-to-hide-except-me-and-my-monkey.cool'
],
trackersBlockedResources: [
'https://everbodys-got-something2-to-hide-except-me-and-my-monkey.cool'
]
})

const wrapper = shallow(baseComponent(newProps))
wrapper.find(`#${componentId}`).simulate('click', target)

const assertion = wrapper.find('#blockedResourcesStats')
assert.equal(assertion.children().length, 1)
})
})

describe('stats for https redirected', () => {
Expand Down

0 comments on commit 4bbe39c

Please sign in to comment.