Skip to content

Commit

Permalink
Merge pull request #5 from MarcL/fix-chatfuel-update-tag
Browse files Browse the repository at this point in the history
Add valid Chatfuel UPDATE tag
  • Loading branch information
MarcL committed Oct 13, 2019
2 parents caf71ea + 52c3002 commit ce784f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/validateFacebookTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@ const deprecatedFacebookTags = [
'TICKET_UPDATE',
];

const chatfuelTags = [
'UPDATE',
];

const validFacebookTags = [
'CONFIRMED_EVENT_UPDATE',
'POST_PURCHASE_UPDATE',
'ACCOUNT_UPDATE',
'HUMAN_AGENT',
];

const allValidTags = [...deprecatedFacebookTags, ...validFacebookTags];
const allValidTags = [...deprecatedFacebookTags, ...validFacebookTags, ...chatfuelTags];

const validateFacebookTags = tag => allValidTags.includes(tag);

Expand Down
3 changes: 3 additions & 0 deletions test/unit/validateFacebookTags.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ describe('Validate Facebook tags', () => {
'POST_PURCHASE_UPDATE',
'ACCOUNT_UPDATE',
'HUMAN_AGENT',

// Chatfuel tags
'UPDATE',
].forEach((tag) => {
it(`should be true if valid tag '${tag}' given`, () => {
expect(validateFacebookTags(tag)).to.be.true;
Expand Down

0 comments on commit ce784f3

Please sign in to comment.