|
| 1 | +const chai = require('chai'); |
| 2 | +const mark = require('../../lib/resources/mark'); |
| 3 | +const common = require('../common'); |
| 4 | + |
| 5 | +chai.should(); |
| 6 | + |
| 7 | +describe('Mark', () => { |
| 8 | + // it('should mark all messages as read', async () => { |
| 9 | + // const validator = (url, options) => { |
| 10 | + // url.should.contain(`${common.config.apiURL}/mark_all_as_read`); |
| 11 | + // Object.keys(options.body.data).length.should.equal(2); |
| 12 | + // options.method.should.be.equal('POST'); |
| 13 | + // }; |
| 14 | + // const output = { |
| 15 | + // msg: '', |
| 16 | + // result: 'success', |
| 17 | + // }; |
| 18 | + // common.stubNetwork(validator, output); |
| 19 | + // const data = await mark(common.config).all(); |
| 20 | + // data.should.have.property('result', 'success'); |
| 21 | + // }); |
| 22 | + |
| 23 | + // it('should mark stream as read', async () => { |
| 24 | + // const params = { |
| 25 | + // stream_id: 15, |
| 26 | + // }; |
| 27 | + // const validator = (url, options) => { |
| 28 | + // url.should.contain(`${common.config.apiURL}/mark_stream_as_read`); |
| 29 | + // Object.keys(options.body.data).length.should.equal(2); |
| 30 | + // options.method.should.be.equal('POST'); |
| 31 | + // }; |
| 32 | + // const output = { |
| 33 | + // msg: '', |
| 34 | + // result: 'success', |
| 35 | + // }; |
| 36 | + // common.stubNetwork(validator, output); |
| 37 | + // const dataStream = await mark(common.config).stream(params); |
| 38 | + // dataStream.should.have.property('result', 'success'); |
| 39 | + // }); |
| 40 | + |
| 41 | + it('should mark topic as read', async () => { |
| 42 | + const params = { |
| 43 | + stream_id: 15, |
| 44 | + topic_name: 'Denmark1', |
| 45 | + }; |
| 46 | + const validator = (url, options) => { |
| 47 | + url.should.contain(`${common.config.apiURL}/mark_topic_as_read`); |
| 48 | + Object.keys(options.body.data).length.should.equal(2); |
| 49 | + options.method.should.be.equal('POST'); |
| 50 | + }; |
| 51 | + const output = { |
| 52 | + msg: '', |
| 53 | + result: 'success', |
| 54 | + }; |
| 55 | + common.stubNetwork(validator, output); |
| 56 | + const dataTopic = await mark(common.config).topic(params); |
| 57 | + dataTopic.should.have.property('result', 'success'); |
| 58 | + }); |
| 59 | +}); |
0 commit comments