-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: searchable contacts on introductions form (#5632)
- Loading branch information
1 parent
77ba876
commit cc05552
Showing
4 changed files
with
89 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
describe('Introduction', function () { | ||
beforeEach(function () { | ||
cy.login(); | ||
cy.createContact('John', 'Doe', 'Man'); | ||
cy.createContact('Jane', 'Doe', 'Woman'); | ||
cy.createContact('Joe', 'Shmoe', 'Man'); | ||
}); | ||
|
||
it('lets you fill first met without an introducer', function () { | ||
cy.url().should('include', '/people/h:'); | ||
|
||
cy.get('.introductions a[href$="introductions/edit"]').click(); | ||
cy.url().should('include', '/introductions/edit'); | ||
|
||
cy.get('textarea[name=first_met_additional_info]').type('Lorem ipsum'); | ||
cy.get('button.btn-primary[type=submit]').click(); | ||
|
||
cy.url().should('include', '/people/h:'); | ||
cy.get('.alert-success'); | ||
cy.get('.introductions').contains('Lorem ipsum'); | ||
}); | ||
|
||
it('lets you save first met', function () { | ||
cy.url().should('include', '/people/h:'); | ||
|
||
cy.get('.introductions a[href$="introductions/edit"]').click(); | ||
cy.url().should('include', '/introductions/edit'); | ||
|
||
cy.get('textarea[name=first_met_additional_info]').type('Lorem ipsum'); | ||
cy.get('#metThrough > .v-select input').click(); | ||
cy.get('#metThrough ul[role="listbox"]').contains('John Doe'); | ||
cy.get('#metThrough ul[role="listbox"]').contains('Jane Doe'); | ||
cy.get('#metThrough ul[role="listbox"]').contains('Joe Shmoe'); | ||
|
||
cy.get('#metThrough ul[role="listbox"]').contains('John Doe').click(); | ||
|
||
cy.get('button.btn-primary[type=submit]').click(); | ||
|
||
cy.url().should('include', '/people/h:'); | ||
cy.get('.alert-success'); | ||
cy.get('.introductions').contains('Lorem ipsum'); | ||
cy.get('.introductions').contains('John Doe'); | ||
}); | ||
|
||
it('lets you search first met', function () { | ||
cy.url().should('include', '/people/h:'); | ||
|
||
cy.get('.introductions a[href$="introductions/edit"]').click(); | ||
cy.url().should('include', '/introductions/edit'); | ||
|
||
cy.get('textarea[name=first_met_additional_info]').type('Lorem ipsum'); | ||
cy.get('#metThrough input[type=search]').type('John'); | ||
cy.get('#metThrough ul[role="listbox"]').contains('John Doe'); | ||
cy.get('#metThrough ul[role="listbox"]').should('not.contain', 'Joe Shmoe'); | ||
cy.get('#metThrough ul[role="listbox"]').should('not.contain', 'Jane Doe'); | ||
|
||
cy.get('#metThrough ul[role="listbox"]').contains('John Doe').click(); | ||
cy.get('button.btn-primary[type=submit]').click(); | ||
|
||
cy.url().should('include', '/people/h:'); | ||
cy.get('.introductions').contains('Lorem ipsum'); | ||
cy.get('.introductions').contains('John Doe'); | ||
}); | ||
|
||
}); |