Skip to content

Commit

Permalink
test(notification): refactor assertions
Browse files Browse the repository at this point in the history
Co-authored-by: Aykut Saraç <[email protected]>
Signed-off-by: Ogun Babacan <[email protected]>
  • Loading branch information
ogunb and AykutSarac committed Nov 27, 2023
1 parent 4ed0de6 commit cd22d6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/components/alert/bl-alert.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,11 @@ describe("Slot", () => {
);

const actionSlot = el.shadowRoot!.querySelector('slot[name="action"]') as HTMLSlotElement;
const actionElement = actionSlot?.assignedElements()[0] as HTMLElement;
const [actionElement, actionSpanElement] = actionSlot.assignedElements();

expect(actionElement).to.exist;
expect(actionElement as HTMLElement).to.exist;
expect(actionElement.tagName).to.eq("BL-BUTTON");

const actionSpanElement = actionSlot?.assignedElements()[1] as HTMLElement;

expect(actionSpanElement).to.not.exist;
expect(actionSpanElement as HTMLElement).to.not.exist;

const actionSecondarySlot = el.shadowRoot!.querySelector(
'slot[name="action-secondary"]'
Expand Down
1 change: 0 additions & 1 deletion src/components/notification/bl-notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ export default class BlNotification extends LitElement {
// Allow only moving up
const movedY = Math.min(currentY - this.touchStartY, 0);

console.log(movedY);
currentTarget.style.transform = `translateY(${movedY}px)`;
}

Expand Down

0 comments on commit cd22d6a

Please sign in to comment.