Skip to content

Instantly share code, notes, and snippets.

@jmaicaaan
Created November 28, 2021 12:19
Show Gist options
  • Save jmaicaaan/d61cc03f812de251a9e0e5fc59a91790 to your computer and use it in GitHub Desktop.
Save jmaicaaan/d61cc03f812de251a9e0e5fc59a91790 to your computer and use it in GitHub Desktop.
describe('fb social login', () => {
it('should be able to login with fb', () => {
cy.visit('http://localhost:3000');
return cy.loginByFacebook().then(() => {
cy.get('[data-testid="fb-login-button"]')
.should('be.enabled')
.click();
cy.location('pathname').should('eq', '/home');
});
});
it('should fail to login with fb', () => {
cy.visit('http://localhost:3000');
return cy.loginByFacebook('not_authorized').then(() => {
cy.get('[data-testid="fb-login-button"]')
.should('be.enabled')
.click();
cy.location('pathname').should('eq', '/');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment