Skip to content

Commit 2bed34c

Browse files
committed
test fixes
1 parent 65ed630 commit 2bed34c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/common/utils/pagination.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('AutoPaginatable', () => {
6464
const resultPromise = paginatable.autoPagination();
6565

6666
// Fast-forward through setTimeout calls
67-
jest.advanceTimersByTimeAsync(250);
67+
await jest.advanceTimersByTimeAsync(350);
6868

6969
const result = await resultPromise;
7070

@@ -114,10 +114,10 @@ describe('AutoPaginatable', () => {
114114

115115
const resultPromise = paginatable.autoPagination();
116116

117-
jest.advanceTimersByTimeAsync(250);
117+
await jest.advanceTimersByTimeAsync(700); // 350ms * 2 for two pages
118118
await resultPromise;
119119

120-
expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 250);
120+
expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 350);
121121
});
122122

123123
it('passes through additional options to API calls', async () => {

src/organizations/organizations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class Organizations {
113113

114114
async listOrganizationFeatureFlags(
115115
options: ListOrganizationFeatureFlagsOptions,
116-
): Promise<AutoPaginatable<FeatureFlag>> {
116+
): Promise<AutoPaginatable<FeatureFlag, ListOrganizationFeatureFlagsOptions>> {
117117
const { organizationId, ...paginationOptions } = options;
118118

119119
return new AutoPaginatable(
@@ -130,7 +130,7 @@ export class Organizations {
130130
deserializeFeatureFlag,
131131
params,
132132
),
133-
paginationOptions,
133+
options,
134134
);
135135
}
136136
}

0 commit comments

Comments
 (0)