Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
devrnt committed Mar 12, 2023
1 parent 1fa97a8 commit 8f7ff67
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tall-buses-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-use-intercom': major
---

Allow calling "boot" multiple times. Previously it was not possible to invoke "boot" more than once, because of a "isBooted" guard. This behaviour was not in line with the IntercomJS docs, so it has been removed
27 changes: 27 additions & 0 deletions packages/react-use-intercom/cypress/e2e/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,31 @@ describe('boot', () => {
cy.get('[data-cy=show]').click();
cy.get('.intercom-lightweight-app-launcher-icon-open').should('not.exist');
});

it('should allow calling `boot` multiple times', () => {
cy.get('[data-cy=boot]').click();

// Wait for the route aliased as 'intercomPing' to respond
// without changing or stubbing its response
cy.wait('@intercomPing');

cy.get('.intercom-lightweight-app-launcher-icon-open').should('exist');
cy.window().should('have.property', 'Intercom');
cy.window().should('have.deep.property', 'intercomSettings', {
app_id: 'jcabc7e3',
});

cy.get('[data-cy="boot-seeded"]').click();

// Wait for the route aliased as 'intercomPing' to respond
// without changing or stubbing its response
cy.wait('@intercomPing');

cy.get('.intercom-lightweight-app-launcher-icon-open').should('exist');
cy.window().should('have.property', 'Intercom');
cy.window().should('have.deep.property', 'intercomSettings', {
app_id: 'jcabc7e3',
name: 'Russo',
});
});
});

0 comments on commit 8f7ff67

Please sign in to comment.