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

Commit

Permalink
Allow deleting folder from add/edit
Browse files Browse the repository at this point in the history
Auditors: @bsclifton

Fix #3409
  • Loading branch information
bbondy committed Aug 27, 2016
1 parent c2b3ab3 commit 608f4e8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/components/addEditBookmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ class AddEditBookmark extends ImmutableComponent {
this.onClose()
}
onRemoveBookmark () {
appActions.removeSite(this.props.currentDetail, siteTags.BOOKMARK)
const tag = this.isFolder ? siteTags.BOOKMARK_FOLDER : siteTags.BOOKMARK
appActions.removeSite(this.props.currentDetail, tag)
this.updateMenuBookmarkedStatus(false)
this.onClose()
}
Expand Down
27 changes: 26 additions & 1 deletion test/components/bookmarksTest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global describe, it, before */

const Brave = require('../lib/brave')
const {urlInput, navigator, navigatorNotBookmarked, saveButton} = require('../lib/selectors')
const {urlInput, navigator, navigatorNotBookmarked, saveButton, deleteButton} = require('../lib/selectors')

describe('bookmarks', function () {
function * setup (client) {
Expand Down Expand Up @@ -56,6 +56,19 @@ describe('bookmarks', function () {
.then((val) => val === 'Page 1')
})
})

describe('and then removed', function () {
before(function *() {
yield this.app.client
.click(navigatorNotBookmarked)
.waitForExist(deleteButton)
.click(deleteButton)
})
it('removes the bookmark from the toolbar', function * () {
yield this.app.client
.waitForExist('.bookmarkText', 1000, true)
})
})
})
})

Expand Down Expand Up @@ -103,6 +116,18 @@ describe('bookmarks', function () {
.then((val) => val === page1Url)
})
})
describe('and then removed', function () {
before(function *() {
yield this.app.client
.click(navigatorNotBookmarked)
.waitForExist(deleteButton)
.click(deleteButton)
})
it('removes the bookmark from the toolbar', function * () {
yield this.app.client
.waitForExist('.bookmarkText', 1000, true)
})
})
})
})
})
1 change: 1 addition & 0 deletions test/lib/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = {
clearBrowsingDataButton: '.clearBrowsingDataButton',
securityTab: '[data-l10n-id="security"]',
saveButton: '[data-l10n-id="save"]',
deleteButton: '[data-l10n-id="delete"]',
autofillAddressPanel: '.autofillAddressPanel',
autofillCreditCardPanel: '.autofillCreditCardPanel'
}

0 comments on commit 608f4e8

Please sign in to comment.