req.reply(response)
}
).as('savedViews')
+
+ cy.intercept('http://localhost:8000/api/mail_accounts/*', {
+ fixture: 'mail_accounts/mail_accounts.json',
+ })
+ cy.intercept('http://localhost:8000/api/mail_rules/*', {
+ fixture: 'mail_rules/mail_rules.json',
+ }).as('mailRules')
+ cy.intercept('http://localhost:8000/api/tasks/', {
+ fixture: 'tasks/tasks.json',
+ })
})
cy.fixture('documents/documents.json').then((documentsJson) => {
cy.viewport(1024, 1600)
cy.visit('/settings')
- cy.wait('@savedViews')
+ cy.wait('@mailRules')
})
it('should activate / deactivate save button when settings change and are saved', () => {
cy.contains('a', 'Dashboard').click()
cy.contains('You have unsaved changes')
cy.contains('button', 'Cancel').click()
- cy.contains('button', 'Save').click().wait('@savedViews')
+ cy.contains('button', 'Save').click().wait('@savedViews').wait(2000)
cy.contains('a', 'Dashboard').click()
cy.contains('You have unsaved changes').should('not.exist')
})
})
it('should remove saved view from sidebar when unset', () => {
- cy.contains('a', 'Saved views').click()
+ cy.contains('a', 'Saved views').click().wait(2000)
cy.get('#show_in_sidebar_1').click()
cy.contains('button', 'Save').click().wait('@savedViews')
cy.contains('li', 'Inbox').should('not.exist')
--- /dev/null
+{
+ "count": 2,
+ "next": null,
+ "previous": null,
+ "results": [
+ {
+ "id": 1,
+ "name": "IMAP Server",
+ "imap_server": "imap.example.com",
+ "imap_port": 993,
+ "imap_security": 2,
+ "username": "inbox@example.com",
+ "password": "pass",
+ "character_set": "UTF-8"
+ },
+ {
+ "id": 2,
+ "name": "Gmail",
+ "imap_server": "imap.gmail.com",
+ "imap_port": 993,
+ "imap_security": 2,
+ "username": "user@gmail.com",
+ "password": "pass",
+ "character_set": "UTF-8"
+ }
+ ]
+}
--- /dev/null
+{
+ "count": 1,
+ "next": null,
+ "previous": null,
+ "results": [
+ {
+ "id": 1,
+ "name": "Gmail",
+ "account": 2,
+ "folder": "INBOX",
+ "filter_from": null,
+ "filter_subject": "[paperless]",
+ "filter_body": null,
+ "filter_attachment_filename": null,
+ "maximum_age": 30,
+ "action": 3,
+ "action_parameter": null,
+ "assign_title_from": 1,
+ "assign_tags": [
+ 9
+ ],
+ "assign_correspondent_from": 1,
+ "assign_correspondent": 2,
+ "assign_document_type": null,
+ "order": 0,
+ "attachment_type": 2
+ }
+ ]
+}
-{"count":3,"next":null,"previous":null,"results":[{"id":1,"name":"Inbox","show_on_dashboard":true,"show_in_sidebar":true,"sort_field":"created","sort_reverse":true,"filter_rules":[{"rule_type":6,"value":"18"}]},{"id":2,"name":"Recently Added","show_on_dashboard":true,"show_in_sidebar":false,"sort_field":"created","sort_reverse":true,"filter_rules":[]},{"id":11,"name":"Taxes","show_on_dashboard":false,"show_in_sidebar":true,"sort_field":"created","sort_reverse":true,"filter_rules":[{"rule_type":6,"value":"39"}]}]}
+{
+ "count": 3,
+ "next": null,
+ "previous": null,
+ "results": [
+ {
+ "id": 1,
+ "name": "Inbox",
+ "show_on_dashboard": true,
+ "show_in_sidebar": true,
+ "sort_field": "created",
+ "sort_reverse": true,
+ "filter_rules": [
+ {
+ "rule_type": 6,
+ "value": "18"
+ }
+ ]
+ },
+ {
+ "id": 2,
+ "name": "Recently Added",
+ "show_on_dashboard": true,
+ "show_in_sidebar": false,
+ "sort_field": "created",
+ "sort_reverse": true,
+ "filter_rules": []
+ },
+ {
+ "id": 11,
+ "name": "Taxes",
+ "show_on_dashboard": false,
+ "show_in_sidebar": true,
+ "sort_field": "created",
+ "sort_reverse": true,
+ "filter_rules": [
+ {
+ "rule_type": 6,
+ "value": "39"
+ }
+ ]
+ }
+ ]
+}