jam-cloud/jam-ui/cypress/integration/friends/friends-list.spec.js

35 lines
844 B
JavaScript
Raw Normal View History

2021-08-11 08:12:32 +00:00
/// <reference types="cypress" />
import { iteratee } from "lodash"
describe("Friends Index page", () => {
2021-08-11 08:26:45 +00:00
describe('For unauthenticated user', () => {
2021-08-11 08:12:32 +00:00
beforeEach(() => {
2021-08-11 08:26:45 +00:00
cy.stubUnauthenticate()
2021-08-11 08:12:32 +00:00
cy.visit('/friends')
})
it("should not list musicians", () => {
cy.contains("Find New Friends").should('exist')
cy.contains("Update Search").should('exist')
cy.contains("Reset Filters").should('exist')
cy.get('[data-testid=peopleListTable]').should('not.exist')
})
})
2021-08-11 08:26:45 +00:00
describe("For authenticated user", () => {
beforeEach(() => {
cy.stubAuthenticate()
cy.intercept('GET', '/filter', { fixture: 'people' })
cy.visit('/friends')
})
it("should list musicians", () => {
cy.get('[data-testid=peopleListTable]').should('exist')
})
})
2021-08-11 08:12:32 +00:00
})