Skip to content

Commit

Permalink
Don't specify lastRefreshTime in integration tests
Browse files Browse the repository at this point in the history
Since specifying this when importing users isn't supported.
  • Loading branch information
rsgowman committed Jun 22, 2022
1 parent 8bb80c1 commit f072d6b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/integration/auth.spec.ts
Expand Up @@ -31,7 +31,7 @@ import { deepExtend, deepCopy } from '../../src/utils/deep-copy';
import {
AuthProviderConfig, CreateTenantRequest, DeleteUsersResult, PhoneMultiFactorInfo,
TenantAwareAuth, UpdatePhoneMultiFactorInfoRequest, UpdateTenantRequest, UserImportOptions,
UserImportRecord, UserRecord, getAuth,
UserImportRecord, UserMetadata, UserRecord, getAuth,
} from '../../lib/auth/index';

const chalk = require('chalk'); // eslint-disable-line @typescript-eslint/no-var-requires
Expand Down Expand Up @@ -2517,7 +2517,8 @@ describe('admin.auth', () => {
metadata: {
lastSignInTime: now,
creationTime: now,
lastRefreshTime: null, // TODO(rsgowman): Switch to 'now' once importing users supports lastRefreshTime
// TODO(rsgowman): Enable once importing users supports lastRefreshTime
//lastRefreshTime: now,
},
providerData: [
{
Expand Down Expand Up @@ -2549,6 +2550,11 @@ describe('admin.auth', () => {
providerId: 'phone',
phoneNumber: importUserRecord.phoneNumber!,
});
// The lastRefreshTime should be set to null
type Writable<UserMetadata> = {
-readonly [k in keyof UserMetadata]: UserMetadata[k];
};
(importUserRecord.metadata as Writable<UserMetadata>).lastRefreshTime = null;
const actualUserRecord: {[key: string]: any} = userRecord.toJSON();
for (const key of Object.keys(importUserRecord)) {
expect(JSON.stringify(actualUserRecord[key]))
Expand Down

0 comments on commit f072d6b

Please sign in to comment.