mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-29 13:48:09 -06:00
Feature: OAuth2 Gmail and Outlook email support (#7866)
This commit is contained in:
@@ -4,7 +4,7 @@ import { TestBed } from '@angular/core/testing'
|
||||
import { environment } from 'src/environments/environment'
|
||||
import { commonAbstractPaperlessServiceTests } from './abstract-paperless-service.spec'
|
||||
import { MailAccountService } from './mail-account.service'
|
||||
import { IMAPSecurity } from 'src/app/data/mail-account'
|
||||
import { IMAPSecurity, MailAccountType } from 'src/app/data/mail-account'
|
||||
|
||||
let httpTestingController: HttpTestingController
|
||||
let service: MailAccountService
|
||||
@@ -20,6 +20,7 @@ const mail_accounts = [
|
||||
username: 'user',
|
||||
password: 'pass',
|
||||
is_token: false,
|
||||
account_type: MailAccountType.IMAP,
|
||||
},
|
||||
{
|
||||
name: 'Mail Account 2',
|
||||
@@ -30,6 +31,7 @@ const mail_accounts = [
|
||||
username: 'user',
|
||||
password: 'pass',
|
||||
is_token: false,
|
||||
account_type: MailAccountType.IMAP,
|
||||
},
|
||||
{
|
||||
name: 'Mail Account 3',
|
||||
@@ -40,6 +42,7 @@ const mail_accounts = [
|
||||
username: 'user',
|
||||
password: 'pass',
|
||||
is_token: false,
|
||||
account_type: MailAccountType.IMAP,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -55,20 +58,6 @@ describe(`Additional service tests for MailAccountService`, () => {
|
||||
expect(req.request.method).toEqual('POST')
|
||||
})
|
||||
|
||||
it('should support patchMany', () => {
|
||||
subscription = service.patchMany(mail_accounts).subscribe()
|
||||
mail_accounts.forEach((mail_account) => {
|
||||
const req = httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}${endpoint}/${mail_account.id}/`
|
||||
)
|
||||
expect(req.request.method).toEqual('PATCH')
|
||||
req.flush(mail_account)
|
||||
})
|
||||
httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}${endpoint}/?page=1&page_size=100000`
|
||||
)
|
||||
})
|
||||
|
||||
it('should support reload', () => {
|
||||
service['reload']()
|
||||
const req = httpTestingController.expectOne(
|
||||
|
||||
Reference in New Issue
Block a user