Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
Improved broadcast test to remove label on start (if exist)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtomczyk committed Dec 13, 2018
1 parent 4b6aa95 commit 0b44ba5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/4_broadcast_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@ const config = require('./config')
const incredbot = new Incredbot(config.incredbot)
const expect = require('chai').expect
const should = require('chai').should()
const axios = require('axios')

describe('Broadcast Class', function () {
let labelId = null
let labelIdToDelete = null
let creativeId = null
let creativeId2 = null
let broadcastId = null
let estimationId = null
this.timeout(8000)

before(async () => {
let list = await incredbot.broadcast.listLabels()
list.data.map(label => {
if(label.name === config.testLabelName) labelIdToDelete = label.id
})
if(labelIdToDelete) await axios.delete(`https://graph.facebook.com/v3.2/${labelIdToDelete}?access_token=${incredbot.access_token}`)
})

it('Should create messages with createMessage()', async () => {
creativeId = await incredbot.broadcast.createMessage(new incredbot.Message.Text('Testing...'))
creativeId2 = await incredbot.broadcast.createMessage(new incredbot.Message.Text('Testing 2...'))
Expand Down

0 comments on commit 0b44ba5

Please sign in to comment.