Skip to content

Commit

Permalink
Merge pull request #975 from CommitChange/chore/ramda-spec
Browse files Browse the repository at this point in the history
remove ramda from spec
  • Loading branch information
wwahammy authored Dec 21, 2024
2 parents 847ec05 + 9d61473 commit b4b4e70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions spec/js/nonprofits/donate/amount-step-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const snabbdom = require('snabbdom')
const flyd = require('flyd')
const render = require('ff-core/render')
const amount = require("../../../../client/js/nonprofits/donate/amount-step")
const R = require('ramda')
const assert = require('assert')

window.log = x => y => console.log(x,y)
Expand Down Expand Up @@ -36,14 +35,14 @@ const init = (donationDefaults, params$) => {
return streams
}

const allText = R.map(R.prop('textContent'))
const allText = (input => input.map(item => item.textContent))
const defaultDesigOptions = ['Choose a designation (optional)', 'Use my donation where most needed']

suite("donate wiz / amount step")
test("shows a designation dropdown if the multiple_designations param is set", ()=> {
let streams = init({}, flyd.stream({multiple_designations: ['a','b']}))
let options = allText(streams.dom$().querySelectorAll('.donate-designationDropdown option'))
assert.deepEqual(options, R.concat(defaultDesigOptions, ['a', 'b']))
assert.deepEqual(options, [...defaultDesigOptions, 'a', 'b'])
})

test('sets no designation with a dropdown on the default value', () => {
Expand Down
3 changes: 1 addition & 2 deletions spec/js/nonprofits/donate/wizard-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const snabbdom = require('snabbdom')
const flyd = require('flyd')
const render = require('ff-core/render')
const wiz = require("../../../../client/js/nonprofits/donate/wizard")
const R = require('ramda')
const assert = require('assert')

window.log = x => y => console.log(x,y)
Expand Down Expand Up @@ -41,7 +40,7 @@ suite("donate wizzzzz")
test("initializes amount, info, and payment steps", ()=> {
let streams = init()
let labels = streams.dom$().querySelectorAll('.ff-wizard-index-label')
assert.deepEqual(R.map(R.prop('textContent'), labels), ['Amount', 'Info', 'Payment'])
assert.deepEqual(labels.map(l => l.text), ['Amount', 'Info', 'Payment'])
})

test("shows the nonprofit name without a campaign", () => {
Expand Down

0 comments on commit b4b4e70

Please sign in to comment.