-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Remove act from selectors (#64)
- Loading branch information
1 parent
c19106e
commit 574619a
Showing
5 changed files
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/converter/test/inputs/converter-no-typecheck/strip-external-imports.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
/* eslint-env browser */ | ||
import { ComponentWrapper, usesDom } from '@cloudscape-design/test-utils-core/dom'; | ||
import { KeyCode } from '@cloudscape-design/test-utils-core/utils'; | ||
import { act } from '@cloudscape-design/test-utils-core/utils-dom'; | ||
|
||
export default class DummyWrapper extends ComponentWrapper { | ||
findElement(): ComponentWrapper { | ||
return new ComponentWrapper(this.find('.awsui-child')!.getElement()); | ||
} | ||
|
||
@usesDom | ||
findDomElement(): ComponentWrapper { | ||
return new ComponentWrapper(this.find('.awsui-child')!.getElement()); | ||
} | ||
|
||
@usesDom | ||
openDropdown(): void { | ||
act(() => { | ||
this.findElement().click(); | ||
}); | ||
} | ||
|
||
findSomething(): number { | ||
return KeyCode.enter; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Use this file for any utilities specific to React/ReactDOM APIs or those that depend on them. | ||
|
||
import * as React from 'react'; | ||
import { act as reactDomAct } from 'react-dom/test-utils'; | ||
|
||
export const act = ('act' in React ? React.act : reactDomAct) as typeof reactDomAct; |