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

Commit

Permalink
Merge pull request #10180 from brave/9750
Browse files Browse the repository at this point in the history
replace yes/no to allow/deny for notifcation bar
  • Loading branch information
cezaraugusto committed Aug 6, 2017
2 parents f0d9c3d + 4f0e185 commit 821b207
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions app/browser/reducers/autoplayReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const showAutoplayMessageBox = (state, tabId) => {

appActions.showNotification({
buttons: [
{text: locale.translation('yes')},
{text: locale.translation('no')}
{text: locale.translation('allow')},
{text: locale.translation('deny')}
],
message,
frameOrigin: origin,
Expand Down
8 changes: 4 additions & 4 deletions app/browser/reducers/passwordManagerReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ const savePassword = (username, origin, tabId) => {
// Notification not shown already
appActions.showNotification({
buttons: [
{text: locale.translation('yes')},
{text: locale.translation('no')},
{text: locale.translation('allow')},
{text: locale.translation('deny')},
{text: locale.translation('neverForThisSite')}
],
options: {
Expand Down Expand Up @@ -149,8 +149,8 @@ const updatePassword = (username, origin, tabId) => {
// Notification not shown already
appActions.showNotification({
buttons: [
{text: locale.translation('yes')},
{text: locale.translation('no')}
{text: locale.translation('allow')},
{text: locale.translation('deny')}
],
options: {
persist: false,
Expand Down
4 changes: 2 additions & 2 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ app.on('ready', () => {
} else {
appActions.showNotification({
buttons: [
{text: locale.translation('yes')},
{text: locale.translation('no')}
{text: locale.translation('allow')},
{text: locale.translation('deny')}
],
options: {
persist: false
Expand Down
4 changes: 2 additions & 2 deletions js/about/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ class AboutStyle extends ImmutableComponent {
<BrowserButton groupedItem secondaryColor notificationItem l10nId='notificationItem' onClick={this.onEnableAutoplay} />
<BrowserButton groupedItem secondaryColor notificationItem l10nId='notificationItem' onClick={this.onEnableAutoplay} />
<Pre><Code>
&lt;BrowserButton groupedItem secondaryColor notificationItem l10nId='Yes' onClick={'{this.onEnableAutoplay}'} />{'\n'}
&lt;BrowserButton groupedItem secondaryColor notificationItem l10nId='No' onClick={'{this.onEnableAutoplay}'} />
&lt;BrowserButton groupedItem secondaryColor notificationItem l10nId='Allow' onClick={'{this.onEnableAutoplay}'} />{'\n'}
&lt;BrowserButton groupedItem secondaryColor notificationItem l10nId='Deny' onClick={'{this.onEnableAutoplay}'} />
</Code></Pre>

<BrowserButton iconOnly iconClass={globalStyles.appIcons.moreInfo} size='30px' color='rebeccapurple' />
Expand Down
26 changes: 13 additions & 13 deletions test/bravery-components/notificationBarTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('notificationBar passwords', function () {
return this.getText(notificationBar).then((val) => {
return val.includes('brave') && val.includes('brave_user')
})
}).click('button=No')
}).click('button=Deny')
})

it('does not include a password in the notification bar', function * () {
Expand All @@ -144,7 +144,7 @@ describe('notificationBar passwords', function () {
return this.getText(notificationBar).then((val) => {
return val.includes('your password') && !val.includes('secret')
})
}).click('button=No')
}).click('button=Deny')
})

it('autofills remembered password on login form', function * () {
Expand All @@ -159,7 +159,7 @@ describe('notificationBar passwords', function () {
.waitForExist(notificationBar)
.waitUntil(function () {
return this.getText(notificationBar).then((val) => val.includes('brave') && val.includes('brave_user'))
}).click('button=Yes')
}).click('button=Allow')
.tabByIndex(0)
.loadUrl('about:passwords')
.waitForExist('[data-test-id="passwordItem"]')
Expand Down Expand Up @@ -189,7 +189,7 @@ describe('notificationBar passwords', function () {
.waitForExist(notificationBar)
.waitUntil(function () {
return this.getText(notificationBar).then((val) => val.includes('brave') && val.includes('brave_user'))
}).click('button=Yes')
}).click('button=Allow')
.tabByIndex(0)
.loadUrl('about:passwords')
.waitForExist('[data-test-id="passwordItem"]')
Expand All @@ -206,7 +206,7 @@ describe('notificationBar passwords', function () {
.waitForExist(notificationBar)
.waitUntil(function () {
return this.getText(notificationBar).then((val) => val.includes('brave') && val.includes('brave_user') && val.includes('update'))
}).click('button=Yes')
}).click('button=Allow')
.tabByIndex(0)
.url(this.loginUrl1)
.waitForExist('#acctmgr_loginform')
Expand Down Expand Up @@ -334,7 +334,7 @@ describe('Autoplay test', function () {
.waitUntil(function () {
return this.getText(notificationBar).then((val) => val.includes('autoplay media'))
})
.click('button=Yes')
.click('button=Allow')
.tabByUrl(url)
.waitUntil(function () {
return this.getText('div[id="status"]')
Expand Down Expand Up @@ -368,7 +368,7 @@ describe('Autoplay test', function () {
return this.getText(notificationBar).then((val) => val.includes('autoplay media'))
})
.click('[data-l10n-id=rememberDecision]')
.click('button=Yes')
.click('button=Allow')
.tabByUrl(url)
.waitUntil(function () {
return this.getText('div[id="status"]')
Expand Down Expand Up @@ -426,7 +426,7 @@ describe('Autoplay test', function () {
.waitUntil(function () {
return this.getText(notificationBar).then((val) => val.includes('autoplay media'))
})
.click('button=No')
.click('button=Deny')
.windowByUrl(Brave.browserWindowUrl)
.activateURLMode()
.click(reloadButton)
Expand Down Expand Up @@ -458,7 +458,7 @@ describe('Autoplay test', function () {
return this.getText(notificationBar).then((val) => val.includes('autoplay media'))
})
.click('[data-l10n-id=rememberDecision]')
.click('button=No')
.click('button=Deny')
.windowByUrl(Brave.browserWindowUrl)
.click(reloadButton)
.tabByUrl(url)
Expand Down Expand Up @@ -522,7 +522,7 @@ describe('Autoplay test', function () {
.waitUntil(function () {
return this.getText(notificationBar).then((val) => val.includes('autoplay media'))
})
.click('button=Yes')
.click('button=Allow')
.tabByUrl(url)
.waitUntil(function () {
return this.getText('div[id="status"]')
Expand Down Expand Up @@ -556,7 +556,7 @@ describe('Autoplay test', function () {
return this.getText(notificationBar).then((val) => val.includes('autoplay media'))
})
.click('[data-l10n-id=rememberDecision]')
.click('button=Yes')
.click('button=Allow')
.tabByUrl(url)
.waitUntil(function () {
return this.getText('div[id="status"]')
Expand Down Expand Up @@ -614,7 +614,7 @@ describe('Autoplay test', function () {
.waitUntil(function () {
return this.getText(notificationBar).then((val) => val.includes('autoplay media'))
})
.click('button=No')
.click('button=Deny')
.windowByUrl(Brave.browserWindowUrl)
.activateURLMode()
.click(reloadButton)
Expand Down Expand Up @@ -646,7 +646,7 @@ describe('Autoplay test', function () {
return this.getText(notificationBar).then((val) => val.includes('autoplay media'))
})
.click('[data-l10n-id=rememberDecision]')
.click('button=No')
.click('button=Deny')
.windowByUrl(Brave.browserWindowUrl)
.click(reloadButton)
.tabByUrl(url)
Expand Down
28 changes: 14 additions & 14 deletions test/unit/app/browser/reducers/autoplayReducerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe('autoplayReducer unit tests', function () {
const message = `Allow ${origin} to autoplay media?`
const showNotificationArg = {
buttons: [
{text: 'Yes'},
{text: 'No'}
{text: 'Allow'},
{text: 'Deny'}
],
message,
frameOrigin: origin,
Expand Down Expand Up @@ -58,11 +58,11 @@ describe('autoplayReducer unit tests', function () {
translation: (msg, arg) => {
let retMsg = ''
switch (msg) {
case 'yes':
retMsg += 'Yes'
case 'allow':
retMsg += 'Allow'
break
case 'no':
retMsg += 'No'
case 'deny':
retMsg += 'Deny'
break
case 'allowAutoplay':
retMsg += `Allow ${arg.origin} to autoplay media?`
Expand Down Expand Up @@ -116,8 +116,8 @@ describe('autoplayReducer unit tests', function () {

it('calls local.translation', function () {
assert(translationSpy.withArgs('allowAutoplay', {origin}).called)
assert(translationSpy.withArgs('yes').called)
assert(translationSpy.withArgs('no').called)
assert(translationSpy.withArgs('allow').called)
assert(translationSpy.withArgs('deny').called)
})

it('calls appActions.showNotification', function () {
Expand Down Expand Up @@ -154,8 +154,8 @@ describe('autoplayReducer unit tests', function () {

it('calls local.translation', function () {
assert(translationSpy.withArgs('allowAutoplay', {origin}).called)
assert(translationSpy.withArgs('yes').called)
assert(translationSpy.withArgs('no').called)
assert(translationSpy.withArgs('allow').called)
assert(translationSpy.withArgs('deny').called)
})

it('calls appActions.showNotification', function () {
Expand Down Expand Up @@ -188,8 +188,8 @@ describe('autoplayReducer unit tests', function () {

it('calls local.translation', function () {
assert(translationSpy.withArgs('allowAutoplay', {origin}).called)
assert(translationSpy.withArgs('yes').called)
assert(translationSpy.withArgs('no').called)
assert(translationSpy.withArgs('allow').called)
assert(translationSpy.withArgs('deny').called)
})

it('calls appActions.showNotification', function () {
Expand Down Expand Up @@ -218,8 +218,8 @@ describe('autoplayReducer unit tests', function () {

it('calls local.translation', function () {
assert(translationSpy.withArgs('allowAutoplay', {origin}).called)
assert(translationSpy.withArgs('yes').called)
assert(translationSpy.withArgs('no').called)
assert(translationSpy.withArgs('allow').called)
assert(translationSpy.withArgs('deny').called)
})

it('calls appActions.showNotification', function () {
Expand Down

0 comments on commit 821b207

Please sign in to comment.