Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@engage_so/node

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@engage_so/node - npm Package Compare versions

Comparing version 1.3.4 to 1.4.0

6

package.json
{
"name": "@engage_so/node",
"version": "1.3.4",
"version": "1.4.0",
"description": "Event driven customer segmentation and targeted engagement.",

@@ -13,3 +13,3 @@ "main": "index.js",

"dependencies": {
"@engage_so/core": "^1.3.4"
"@engage_so/core": "^1.4.0"
},

@@ -21,3 +21,3 @@ "author": "Engage",

},
"gitHead": "b288998ee988a348358f0a39c3747d1049d37dbd"
"gitHead": "243019a68a3906c5cc2faa5c5227e4d497ee8a50"
}
const Engage = require('../index')
const id = '1234'
const gid = 'abcd'

@@ -41,4 +42,4 @@ describe('Init', () => {

test('should not throw if no email passed', async () => {
expect(() => {
Engage.identify({ id })
await expect(() => {
Engage.identify({ id: gid })
}).not.toThrowError()

@@ -122,1 +123,67 @@ })

})
describe('Convert to group', () => {
test('should convert to group', async () => {
await expect(Engage.convertToGroup(gid)).resolves.toMatchObject({
is_group: true
})
})
})
describe('Convert to user', () => {
test('should convert to user', async () => {
await expect(Engage.convertToUser(gid)).resolves.toMatchObject({
is_group: false
})
})
})
describe('Add to group', () => {
test('should throw if no group id added', async () => {
await expect(Engage.addToGroup(id)).rejects.toThrowError(/id/)
})
test('should throw if role and role not string', async () => {
await expect(Engage.addToGroup(id, gid, [ 'something' ])).rejects.toThrowError(/Role/)
})
test('should pass if group id added', async () => {
await expect(Engage.addToGroup(id, gid)).resolves.toMatchObject({
groups: [{
id: gid
}]
})
})
})
describe('Change group role', () => {
test('should throw if no parameters', async () => {
await expect(Engage.changeGroupRole()).rejects.toThrowError(/missing/)
})
test('should throw if no group id', async () => {
await expect(Engage.changeGroupRole(id)).rejects.toThrowError(/missing/)
})
test('should throw if no role', async () => {
await expect(Engage.changeGroupRole(id, gid)).rejects.toThrowError(/missing/)
})
test('should pass if all parameters set', async () => {
await expect(Engage.changeGroupRole(id, gid, 'owner')).resolves.toMatchObject({
groups: [{
id: gid,
role: 'owner'
}]
})
})
})
describe('Remove from group', () => {
test('should throw if no parameters', async () => {
await expect(Engage.removeFromGroup()).rejects.toThrowError(/missing/)
})
test('should throw if no group id', async () => {
await expect(Engage.removeFromGroup(id)).rejects.toThrowError(/missing/)
})
test('should pass if all parameters set', async () => {
await expect(Engage.removeFromGroup(id, gid)).resolves.toMatchObject({
groups: []
})
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc