Skip to content

Commit

Permalink
Allow txt and csv uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia committed Apr 1, 2024
1 parent 4002b3e commit e24f609
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/cypress/integration/features/documents.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,21 @@ describe('Documents Feature', () => {
'pptx-file.pptx',
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
);
uploadFile('txt-file.txt', 'text/plain');
uploadFile('csv-file.csv', 'text/csv');

cy.visit('/?s=dummy+slide');
cy.get('.hentry').should('contain.text', 'pptx-file');

cy.visit('/?s=Curabitur+interdum+id+turpis+ac+viverra');
cy.get('.hentry').should('contain.text', 'txt-file');
cy.wpCli('config set ALLOW_UNFILTERED_UPLOADS true --raw').then(() => {
uploadFile('txt-file.txt', 'text/plain');
uploadFile('csv-file.csv', 'text/csv');

cy.visit('/?s=Winchester');
cy.get('.hentry').should('contain.text', 'csv-file');
cy.visit('/?s=Curabitur+interdum+id+turpis+ac+viverra');
cy.get('.hentry').should('contain.text', 'txt-file');

cy.visit('/?s=Winchester');
cy.get('.hentry').should('contain.text', 'csv-file');

cy.wpCli('config set ALLOW_UNFILTERED_UPLOADS false --raw');
});
});
});

0 comments on commit e24f609

Please sign in to comment.