mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
feat(api): add endpoint for user integration status
This commit is contained in:
parent
7fdb450446
commit
0adbcc3a04
5 changed files with 70 additions and 1 deletions
|
@ -2483,6 +2483,32 @@ func TestSaveEntryEndpoint(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestFetchIntegrationsStatusEndpoint(t *testing.T) {
|
||||
testConfig := newIntegrationTestConfig()
|
||||
if !testConfig.isConfigured() {
|
||||
t.Skip(skipIntegrationTestsMessage)
|
||||
}
|
||||
|
||||
adminClient := miniflux.NewClient(testConfig.testBaseURL, testConfig.testAdminUsername, testConfig.testAdminPassword)
|
||||
|
||||
regularTestUser, err := adminClient.CreateUser(testConfig.genRandomUsername(), testConfig.testRegularPassword, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer adminClient.DeleteUser(regularTestUser.ID)
|
||||
|
||||
regularUserClient := miniflux.NewClient(testConfig.testBaseURL, regularTestUser.Username, testConfig.testRegularPassword)
|
||||
|
||||
hasIntegrations, err := regularUserClient.FetchIntegrationsStatus()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to fetch integrations status: %v", err)
|
||||
}
|
||||
|
||||
if hasIntegrations {
|
||||
t.Fatalf("New user should not have integrations configured")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFetchContentEndpoint(t *testing.T) {
|
||||
testConfig := newIntegrationTestConfig()
|
||||
if !testConfig.isConfigured() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue