Skip to content

Commit

Permalink
chore(pds-popover): update function names to not duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
QuintonJason authored and ju-Skinner committed Feb 27, 2024
1 parent 31e747c commit a04782e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion libs/core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export namespace Components {
/**
* Hides the popover by disabling the opened property
*/
"hidePopover": () => Promise<void>;
"hidePdsPopover": () => Promise<void>;
/**
* Determines whether or not the popover is visible
* @defaultValue false
Expand Down
10 changes: 5 additions & 5 deletions libs/core/src/components/pds-popover/pds-popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class PdsPopover {

componentDidUpdate() {
if (this.opened) {
this.showPopover();
this.showPdsPopover();
}
}

Expand Down Expand Up @@ -102,17 +102,17 @@ export class PdsPopover {
* Hides the popover by disabling the opened property
*/
@Method()
async hidePopover() {
async hidePdsPopover() {
this.opened = false;
}

private handleHide = () => {
this.hidePopover();
this.hidePdsPopover();
this.pdsPopoverHide.emit();
};

private handleShow = () => {
this.showPopover();
this.showPdsPopover();
this.pdsPopoverShow.emit();
};

Expand Down Expand Up @@ -147,7 +147,7 @@ export class PdsPopover {
<span
aria-describedby={this.componentId}
class="pds-popover__trigger"
onClick={() => this.togglePopover()}
onClick={() => this.togglePdsPopover()}
>
<slot />
</span>
Expand Down
2 changes: 1 addition & 1 deletion libs/core/src/components/pds-popover/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

## Methods

### `hidePopover() => Promise<void>`
### `hidePdsPopover() => Promise<void>`

Hides the popover by disabling the opened property

Expand Down
12 changes: 6 additions & 6 deletions libs/core/src/components/pds-popover/test/pds-popover.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ describe('pds-popover', () => {
// Initially, the opened property should be false
expect(popover.opened).toBe(false);

// Call the togglePopover method
await popover.togglePopover();
// Call the togglePdsPopover method
await popover.togglePdsPopover();

// After calling togglePopover, the opened property should be true
// After calling togglePdsPopover, the opened property should be true
expect(popover.opened).toBe(true);

// Call the togglePopover method again
await popover.togglePopover();
// Call the togglePdsPopover method again
await popover.togglePdsPopover();

// After calling togglePopover again, the opened property should be false
// After calling togglePdsPopover again, the opened property should be false
expect(popover.opened).toBe(false);
});

Expand Down

0 comments on commit a04782e

Please sign in to comment.