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

feature test for public link share expiration date deletion #35175

Merged
merged 3 commits into from
May 24, 2019
Merged

feature test for public link share expiration date deletion #35175

merged 3 commits into from
May 24, 2019

Conversation

haribhandari07
Copy link
Contributor

@haribhandari07 haribhandari07 commented May 8, 2019

Description

Includes two tests for deletion of expiration date when the expiration date is not enforced and enforced.

Related Issue

  • Fixes <issue_link>

Motivation and Context

How Has This Been Tested?

  • test environment:

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • 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:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@codecov
Copy link

codecov bot commented May 8, 2019

Codecov Report

Merging #35175 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #35175      +/-   ##
============================================
- Coverage     65.48%   65.48%   -0.01%     
  Complexity    18636    18636              
============================================
  Files          1217     1217              
  Lines         70535    70535              
  Branches       1296     1296              
============================================
- Hits          46193    46189       -4     
- Misses        23965    23969       +4     
  Partials        377      377
Flag Coverage Δ Complexity Δ
#javascript 53.5% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.86% <ø> (-0.01%) 18636 <ø> (ø)
Impacted Files Coverage Δ Complexity Δ
lib/private/DB/Connection.php 65.44% <0%> (-0.74%) 49% <0%> (ø)
lib/private/Files/View.php 84.3% <0%> (-0.31%) 398% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d077f7...c393e44. Read the comment docs.

@codecov
Copy link

codecov bot commented May 8, 2019

Codecov Report

Merging #35175 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #35175   +/-   ##
=========================================
  Coverage     65.54%   65.54%           
  Complexity    18647    18647           
=========================================
  Files          1218     1218           
  Lines         70546    70546           
  Branches       1288     1288           
=========================================
  Hits          46236    46236           
  Misses        23933    23933           
  Partials        377      377
Flag Coverage Δ Complexity Δ
#javascript 53.69% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.9% <ø> (ø) 18647 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6db604e...c6ec250. Read the comment docs.

Copy link
Member

@paurakhsharma paurakhsharma left a comment

Choose a reason for hiding this comment

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

Some small suggestions

Copy link
Member

@skshetry skshetry left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@paurakhsharma paurakhsharma left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

Copy link
Member

@individual-it individual-it left a comment

Choose a reason for hiding this comment

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

just small things

if (!$this->isFieldInResponse($field, $value)) {
PHPUnit\Framework\Assert::fail(
"$field doesn't have value $value"
if ($value != null) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if ($value != null) {
if ($value !== null) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since we are changing the expiration to " " which is empty string(not null) it's better to use (!empty($value))

* @throws ElementNotFoundException
*/
public function getErrorMessage() {
$errorMessageElement = $this->popupElement->find("xpath", $this->expirationDateRequiredErrorMessageXpath);
Copy link
Member

Choose a reason for hiding this comment

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

please make the line shorter / break it

);
}
} else {
PHPUnit\Framework\Assert::assertFalse(
Copy link
Member

Choose a reason for hiding this comment

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

this logic does not look correct to me. We expect the field to be in the response and be empty, so isFieldInResponse() should return true

@individual-it
Copy link
Member

@haribhandari07 please fix the conflicts and ping me again for review

Copy link
Member

@paurakhsharma paurakhsharma left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@individual-it
Copy link
Member

@haribhandari07 please backport to stable10

@haribhandari07
Copy link
Contributor Author

Backport on #35369

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants