Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/contacts import #183

Merged
merged 3 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions cypress/e2e/contactImport/ContactImport.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
describe('Importing contacts', () => {
beforeEach(function () {
// login before each test
cy.login();
cy.visit('/contact-management');
});

it('should upload contacts', () => {
cy.get('[data-testid="uploadContactsBtn"]').click();
cy.wait(500);
cy.get('[data-testid="autocomplete-element"]').click().type('Optin');
cy.get('.MuiAutocomplete-popper').click();
cy.get('input[name=optedIn]').click({ force: true });
cy.get('input[type="file"]#uploadcontacts').selectFile('cypress/fixtures/contacts.csv', {
force: true,
});
cy.get('[data-testid=ok-button]').click();
cy.get('div').should('contain', 'Contact import is in progress');

cy.get('button').contains('Go to notifications').click();
});
});
6 changes: 6 additions & 0 deletions cypress/e2e/notification/notification.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,10 @@ describe('Notification list ', () => {
cy.get('[data-testid=table]').contains('td', 'Flow').next().next().next().next().click();
});
});

it('downloads csv report for contact import', () => {
cy.visit('/notifications');
cy.get('[data-testid="additionalButton"]').first().click();
cy.get('div').should('contain', 'Downloaded the status of the contact upload');
});
});
2 changes: 2 additions & 0 deletions cypress/fixtures/contacts.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name,phone,language,opt_in,delete
Emily Davis,919136946714,Hindi,2023-07-17 08:39:09,0
Loading