mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Migrate to cypress 10
This commit is contained in:
35
src-ui/cypress/e2e/manage/manage.cy.ts
Normal file
35
src-ui/cypress/e2e/manage/manage.cy.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
describe('manage', () => {
|
||||
beforeEach(() => {
|
||||
cy.intercept('http://localhost:8000/api/ui_settings/', {
|
||||
fixture: 'ui_settings/settings.json',
|
||||
})
|
||||
cy.intercept('http://localhost:8000/api/correspondents/*', {
|
||||
fixture: 'correspondents/correspondents.json',
|
||||
})
|
||||
cy.intercept('http://localhost:8000/api/tags/*', {
|
||||
fixture: 'tags/tags.json',
|
||||
})
|
||||
})
|
||||
|
||||
it('should show a list of correspondents with bottom pagination as well', () => {
|
||||
cy.visit('/correspondents')
|
||||
cy.get('tbody').find('tr').its('length').should('eq', 25)
|
||||
cy.get('ngb-pagination').its('length').should('eq', 2)
|
||||
})
|
||||
|
||||
it('should show a list of tags without bottom pagination', () => {
|
||||
cy.visit('/tags')
|
||||
cy.get('tbody').find('tr').its('length').should('eq', 8)
|
||||
cy.get('ngb-pagination').its('length').should('eq', 1)
|
||||
})
|
||||
|
||||
it('should show a list of documents filtered by tag', () => {
|
||||
cy.intercept('http://localhost:8000/api/documents/*', (req) => {
|
||||
if (req.url.indexOf('tags__id__all=4'))
|
||||
req.reply({ count: 3, next: null, previous: null, results: [] })
|
||||
})
|
||||
cy.visit('/tags')
|
||||
cy.get('tbody').find('button:visible').contains('Documents').first().click() // id = 4
|
||||
cy.contains('3 documents')
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user