Skip to content

Commit

Permalink
fix(popover): fix neither type overlaps with the other error
Browse files Browse the repository at this point in the history
Signed-off-by: aurore.stagnol <[email protected]>
  • Loading branch information
astagnol committed Jun 26, 2023
1 parent 74b23fe commit bd5f796
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('spec:ods-popover-controller', () => {
});
it('should change the value of opened attribute on click', async () => {
setup(component);
component.surface = new OcdkSurfaceMock() as OcdkSurface;
component.surface = new OcdkSurfaceMock() as unknown as OcdkSurface;
component.surface!.opened = false;

await controller.handleTriggerClick();
Expand All @@ -65,7 +65,7 @@ describe('spec:ods-popover-controller', () => {
describe('method: handleTriggerKey', () => {
it('should do nothing if key is not ENTER or SPACE or ESCAPE', async () => {
setup(component);
component.surface = new OcdkSurfaceMock() as OcdkSurface;
component.surface = new OcdkSurfaceMock() as unknown as OcdkSurface;
component.surface!.opened = false;

const event = new KeyboardEvent("keypress", {
Expand Down Expand Up @@ -101,7 +101,7 @@ describe('spec:ods-popover-controller', () => {

it('should change the value of opened attribute on ENTER or SPACE press', async () => {
setup(component);
component.surface = new OcdkSurfaceMock() as OcdkSurface;
component.surface = new OcdkSurfaceMock() as unknown as OcdkSurface;
component.surface!.opened = false;

const event = new KeyboardEvent("keypress", {
Expand All @@ -120,7 +120,7 @@ describe('spec:ods-popover-controller', () => {

it('should close the surface on ESCAPE press', async () => {
setup(component);
component.surface = new OcdkSurfaceMock() as OcdkSurface;
component.surface = new OcdkSurfaceMock() as unknown as OcdkSurface;
component.surface!.opened = true;

const event = new KeyboardEvent("keypress", {
Expand All @@ -142,7 +142,7 @@ describe('spec:ods-popover-controller', () => {
it('should do nothing if key is not ESCAPE', async () => {
setup(component);

component.surface = new OcdkSurfaceMock() as OcdkSurface;
component.surface = new OcdkSurfaceMock() as unknown as OcdkSurface;
component.surface!.opened = true;

const event = new KeyboardEvent("keypress", {
Expand All @@ -159,7 +159,7 @@ describe('spec:ods-popover-controller', () => {
it('should close the surface on ESCAPE press', async () => {
setup(component);

component.surface = new OcdkSurfaceMock() as OcdkSurface;
component.surface = new OcdkSurfaceMock() as unknown as OcdkSurface;
component.surface!.opened = true;

const event = new KeyboardEvent("keypress", {
Expand Down Expand Up @@ -196,7 +196,7 @@ describe('spec:ods-popover-controller', () => {
it('should do nothing if surface is not opened', async () => {
setup(component);

component.surface = new OcdkSurfaceMock() as OcdkSurface;
component.surface = new OcdkSurfaceMock() as unknown as OcdkSurface;
component.surface!.opened = false;

const event = new MouseEvent("click", {
Expand All @@ -214,7 +214,7 @@ describe('spec:ods-popover-controller', () => {

it('should do nothing if event target is in the component', async () => {
setup(component);
component.surface = new OcdkSurfaceMock() as OcdkSurface;
component.surface = new OcdkSurfaceMock() as unknown as OcdkSurface;
component.surface!.opened = true;

const event = new MouseEvent("click", {
Expand All @@ -234,7 +234,7 @@ describe('spec:ods-popover-controller', () => {

it('should close the surface when click outside of the component', async () => {
setup(component);
component.surface = new OcdkSurfaceMock() as OcdkSurface;
component.surface = new OcdkSurfaceMock() as unknown as OcdkSurface;
component.surface!.opened = true;

const event = new MouseEvent("click", {
Expand All @@ -260,7 +260,7 @@ describe('spec:ods-popover-controller', () => {
});
it('should do nothing if surface is closed', async () => {
setup(component);
component.surface = new OcdkSurfaceMock() as OcdkSurface;
component.surface = new OcdkSurfaceMock() as unknown as OcdkSurface;
component.surface!.opened = false;

expect(() => { controller.closeSurface() }).not.toThrow();
Expand All @@ -269,7 +269,7 @@ describe('spec:ods-popover-controller', () => {
});
it('should close the surface', async () => {
setup(component);
component.surface = new OcdkSurfaceMock() as OcdkSurface;
component.surface = new OcdkSurfaceMock() as unknown as OcdkSurface;
component.surface!.opened = true;

await controller.closeSurface();
Expand Down

0 comments on commit bd5f796

Please sign in to comment.