mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Multiple documents, filtering, view changes, in document list e2e testing
This commit is contained in:
		
							parent
							
								
									34657fd675
								
							
						
					
					
						commit
						474050ba6b
					
				
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -0,0 +1 @@
 | 
			
		||||
{"count":1,"next":null,"previous":null,"results":[{"id":3,"correspondent":null,"document_type":1,"title":"lorem-ipsum","content":"Test document PDF","tags":[2],"created":"2022-03-24T07:24:18Z","modified":"2022-03-24T07:24:23.264859Z","added":"2022-03-24T07:24:22.922631Z","archive_serial_number":null,"original_file_name":"2022-03-24 lorem-ipsum.pdf","archived_file_name":"2022-03-24 lorem-ipsum.pdf"}]}
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -20,13 +20,37 @@ describe('documents-list', () => {
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  it('should show a list of documents rendered as cards with thumbnails', () => {
 | 
			
		||||
    cy.contains('One document')
 | 
			
		||||
    cy.contains('3 documents')
 | 
			
		||||
    cy.contains('lorem-ipsum')
 | 
			
		||||
    cy.get('app-document-card-small:first-of-type img')
 | 
			
		||||
      .invoke('attr', 'src')
 | 
			
		||||
      .should('eq', 'http://localhost:8000/api/documents/1/thumb/')
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  it('should change to table "details" view', () => {
 | 
			
		||||
    cy.get('div.btn-group-toggle input[value="details"]').parent().click()
 | 
			
		||||
    cy.get('table')
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  it('should change to large cards view', () => {
 | 
			
		||||
    cy.get('div.btn-group-toggle input[value="largeCards"]').parent().click()
 | 
			
		||||
    cy.get('app-document-card-large')
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  it('should filter tags', () => {
 | 
			
		||||
    // e.g. http://localhost:8000/api/documents/?page=1&page_size=50&ordering=-created&tags__id__all=2
 | 
			
		||||
    cy.intercept('http://localhost:8000/api/documents/*', {
 | 
			
		||||
      fixture: 'documents/documents_filtered.json',
 | 
			
		||||
    })
 | 
			
		||||
    cy.get('app-filter-editor app-filterable-dropdown[title="Tags"]').within(
 | 
			
		||||
      () => {
 | 
			
		||||
        cy.contains('button', 'Tags').click()
 | 
			
		||||
        cy.contains('button', 'Tag 2').click()
 | 
			
		||||
      }
 | 
			
		||||
    )
 | 
			
		||||
    cy.contains('One document')
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  it('should apply tags', () => {
 | 
			
		||||
    cy.intercept('http://localhost:8000/api/documents/*', {
 | 
			
		||||
      fixture: 'documents/documents_saved.json',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user