Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci]added test for user trying to accept federation share invitation from same instance #11015

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

PrajwolAmatya
Copy link
Contributor

Description

This PR adds API test for a user trying to accept federation share invitation from same instance.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@@ -178,6 +178,29 @@ public function userHasAcceptedTheLastFederationShareInvitation(string $user): v
$this->featureContext->theHTTPStatusCodeShouldBe(200, '', $response);
}

/**
* @When :user tries to accept the federation share invitation from same instance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this step?
How about using this step or modiying it, rather than adding a new step?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Within this step we want to set the value of providerDomain with the domain of the same instance.

The providerDomain takes the value of domain of the other instance to create federated connection, for instance when using LOCAL server, i.e. localhost:9200, the providerDomain should have value of remote domain localhost:10200.

In existing step we cannot specify providerDomain of same instance. To modify the existing step we some how need to make the providerDomain to take the domain of same instance. And the existing step is written such that the providerDomain takes the domain of the other instance.

So, had to create a new step.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its possible but need refactoring in existing step and need to add more logic. @saw-jan if you fine from adding new step then i am fine with this. So now i am removing my request change. Its upto @saw-jan decision.

"const": "ALREADY_EXIST"
},
"message": {
"const": "user already known"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am just curious what happens when we have user with same credentials in both instance and tries to accept invitation between the identical user in different instance

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For that case, the users in two instances are differentiated via providerDomain. So, there will not be any issues for the federation connection.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and whats the message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For successful connection it doesn't return any message. Messages are returned only for invalid cases.

Copy link
Contributor

@amrita-shrestha amrita-shrestha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait until @saw-jan approves it

@@ -178,6 +178,29 @@ public function userHasAcceptedTheLastFederationShareInvitation(string $user): v
$this->featureContext->theHTTPStatusCodeShouldBe(200, '', $response);
}

/**
* @When :user tries to accept the federation share invitation from same instance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its possible but need refactoring in existing step and need to add more logic. @saw-jan if you fine from adding new step then i am fine with this. So now i am removing my request change. Its upto @saw-jan decision.

@prashant-gurung899
Copy link
Contributor

LGTM 👍

@PrajwolAmatya PrajwolAmatya merged commit ebfa287 into master Feb 19, 2025
3 checks passed
@PrajwolAmatya PrajwolAmatya deleted the test-for-issue-11004 branch February 19, 2025 03:20
ownclouders pushed a commit that referenced this pull request Feb 19, 2025
[tests-only][full-ci]added test for user trying to accept federation share invitation from same instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants