Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 8573887

Browse files
committed
Remove waitForEvent helper function
This function is no longer being used. Also removing a todo comment which no longer is needed since these tests have been implemented in this PR.
1 parent d2a81df commit 8573887

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

common/helpers.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -198,26 +198,6 @@ func createWaitForEventPredicateHandler(
198198
return ch, evCancelFn
199199
}
200200

201-
func waitForEvent(
202-
ctx context.Context,
203-
emitter EventEmitter, events []string,
204-
predicateFn func(data any) bool,
205-
timeout time.Duration,
206-
) (any, error) { //nolint:unparam
207-
ch, evCancelFn := createWaitForEventHandler(ctx, emitter, events, predicateFn)
208-
defer evCancelFn() // Remove event handler
209-
210-
select {
211-
case <-ctx.Done():
212-
case <-time.After(timeout):
213-
return nil, fmt.Errorf("%w after %s", ErrTimedOut, timeout)
214-
case evData := <-ch:
215-
return evData, nil
216-
}
217-
218-
return nil, nil
219-
}
220-
221201
// panicOrSlowMo panics if err is not nil, otherwise applies slow motion.
222202
func panicOrSlowMo(ctx context.Context, err error) {
223203
if err != nil {

tests/page_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,6 @@ func TestPageWaitForFunction(t *testing.T) {
662662
func TestPageWaitForLoadState(t *testing.T) {
663663
t.Parallel()
664664

665-
// TODO: Add happy path tests once WaitForLoadState is not racy.
666-
667665
t.Run("err_wrong_event", func(t *testing.T) {
668666
t.Parallel()
669667

0 commit comments

Comments
 (0)