Browse Source

chore(ts): Suffix all fixtures with `Fixture` (#62455)

This disambiguates them from types.
George Gritsouk 1 year ago
parent
commit
7b9b87b6e3

+ 5 - 5
fixtures/js-stubs/accessRequest.tsx

@@ -1,15 +1,15 @@
-import {Member} from 'sentry-fixture/member';
-import {Team} from 'sentry-fixture/team';
+import {MemberFixture} from 'sentry-fixture/member';
+import {TeamFixture} from 'sentry-fixture/team';
 
 
 import {AccessRequest as AccessRequestType} from 'sentry/types';
 import {AccessRequest as AccessRequestType} from 'sentry/types';
 
 
-export function AccessRequest(
+export function AccessRequestFixture(
   params: Partial<AccessRequestType> = {}
   params: Partial<AccessRequestType> = {}
 ): AccessRequestType {
 ): AccessRequestType {
   return {
   return {
     id: '123',
     id: '123',
-    member: Member(),
-    team: Team(),
+    member: MemberFixture(),
+    team: TeamFixture(),
     ...params,
     ...params,
   };
   };
 }
 }

+ 1 - 1
fixtures/js-stubs/accountEmails.tsx

@@ -1,6 +1,6 @@
 import type {UserEmail} from 'sentry/types';
 import type {UserEmail} from 'sentry/types';
 
 
-export function AccountEmails(params: UserEmail[] = []): UserEmail[] {
+export function AccountEmailsFixture(params: UserEmail[] = []): UserEmail[] {
   return [
   return [
     {
     {
       email: 'primary@example.com',
       email: 'primary@example.com',

+ 8 - 8
fixtures/js-stubs/activityFeed.tsx

@@ -1,6 +1,6 @@
-import {Event} from 'sentry-fixture/event';
-import {Project} from 'sentry-fixture/project';
-import {User} from 'sentry-fixture/user';
+import {EventFixture} from 'sentry-fixture/event';
+import {ProjectFixture} from 'sentry-fixture/project';
+import {UserFixture} from 'sentry-fixture/user';
 
 
 import {
 import {
   type Activity,
   type Activity,
@@ -10,11 +10,11 @@ import {
   IssueType,
   IssueType,
 } from 'sentry/types';
 } from 'sentry/types';
 
 
-export function ActivityFeed(params: Partial<Activity> = {}): Activity {
+export function ActivityFeedFixture(params: Partial<Activity> = {}): Activity {
   return {
   return {
     data: {text: 'Very interesting comment'},
     data: {text: 'Very interesting comment'},
     dateCreated: '2019-04-29T21:43:32.280Z',
     dateCreated: '2019-04-29T21:43:32.280Z',
-    project: Project({
+    project: ProjectFixture({
       features: [
       features: [
         'releases',
         'releases',
         'sample-events',
         'sample-events',
@@ -35,7 +35,7 @@ export function ActivityFeed(params: Partial<Activity> = {}): Activity {
       firstEvent: '2019-03-09T06:56:15Z',
       firstEvent: '2019-03-09T06:56:15Z',
       isMember: true,
       isMember: true,
     }),
     }),
-    user: User({
+    user: UserFixture({
       username: 'billy@sentry.io',
       username: 'billy@sentry.io',
       lastLogin: '2019-04-23T00:10:19.787Z',
       lastLogin: '2019-04-23T00:10:19.787Z',
       isSuperuser: true,
       isSuperuser: true,
@@ -81,7 +81,7 @@ export function ActivityFeed(params: Partial<Activity> = {}): Activity {
       issueCategory: IssueCategory.ERROR,
       issueCategory: IssueCategory.ERROR,
       issueType: IssueType.ERROR,
       issueType: IssueType.ERROR,
       participants: [],
       participants: [],
-      latestEvent: Event(),
+      latestEvent: EventFixture(),
       isUnhandled: true,
       isUnhandled: true,
       pluginActions: [],
       pluginActions: [],
       pluginContexts: [],
       pluginContexts: [],
@@ -109,7 +109,7 @@ export function ActivityFeed(params: Partial<Activity> = {}): Activity {
       level: 'error',
       level: 'error',
       isSubscribed: true,
       isSubscribed: true,
       isBookmarked: false,
       isBookmarked: false,
-      project: Project({
+      project: ProjectFixture({
         platform: undefined,
         platform: undefined,
         slug: 'internal',
         slug: 'internal',
         id: '1',
         id: '1',

+ 1 - 1
fixtures/js-stubs/actor.tsx

@@ -1,6 +1,6 @@
 import type {Actor as ActorType} from 'sentry/types';
 import type {Actor as ActorType} from 'sentry/types';
 
 
-export function Actor(params: Partial<ActorType> = {}): ActorType {
+export function ActorFixture(params: Partial<ActorType> = {}): ActorType {
   return {
   return {
     id: '1',
     id: '1',
     email: 'foo@example.com',
     email: 'foo@example.com',

+ 1 - 1
fixtures/js-stubs/apiApplication.tsx

@@ -1,6 +1,6 @@
 import type {ApiApplication as ApiApplicationType} from 'sentry/types';
 import type {ApiApplication as ApiApplicationType} from 'sentry/types';
 
 
-export function ApiApplication(
+export function ApiApplicationFixture(
   params: Partial<ApiApplicationType> = {}
   params: Partial<ApiApplicationType> = {}
 ): ApiApplicationType {
 ): ApiApplicationType {
   return {
   return {

+ 1 - 1
fixtures/js-stubs/apiToken.tsx

@@ -1,6 +1,6 @@
 import type {InternalAppApiToken as InternalAppApiTokenType} from 'sentry/types';
 import type {InternalAppApiToken as InternalAppApiTokenType} from 'sentry/types';
 
 
-export function ApiToken(
+export function ApiTokenFixture(
   params: Partial<InternalAppApiTokenType> = {}
   params: Partial<InternalAppApiTokenType> = {}
 ): InternalAppApiTokenType {
 ): InternalAppApiTokenType {
   return {
   return {

+ 4 - 4
fixtures/js-stubs/auditLogs.tsx

@@ -1,8 +1,8 @@
-import {User} from 'sentry-fixture/user';
+import {UserFixture} from 'sentry-fixture/user';
 
 
 import type {AuditLog as AuditLogType} from 'sentry/types';
 import type {AuditLog as AuditLogType} from 'sentry/types';
 
 
-export function AuditLogs(params: AuditLogType[] = []): AuditLogType[] {
+export function AuditLogsFixture(params: AuditLogType[] = []): AuditLogType[] {
   return [
   return [
     {
     {
       note: 'edited project ludic-science',
       note: 'edited project ludic-science',
@@ -18,7 +18,7 @@ export function AuditLogs(params: AuditLogType[] = []): AuditLogType[] {
       dateCreated: '2018-02-21T03:04:23.157Z',
       dateCreated: '2018-02-21T03:04:23.157Z',
       ipAddress: '127.0.0.1',
       ipAddress: '127.0.0.1',
       id: '465',
       id: '465',
-      actor: User({isSuperuser: true}),
+      actor: UserFixture({isSuperuser: true}),
       event: 'project.edit',
       event: 'project.edit',
     },
     },
     {
     {
@@ -29,7 +29,7 @@ export function AuditLogs(params: AuditLogType[] = []): AuditLogType[] {
       dateCreated: '2018-02-16T23:45:59.813Z',
       dateCreated: '2018-02-16T23:45:59.813Z',
       ipAddress: '127.0.0.1',
       ipAddress: '127.0.0.1',
       id: '408',
       id: '408',
-      actor: User({isSuperuser: false}),
+      actor: UserFixture({isSuperuser: false}),
       event: 'org.edit',
       event: 'org.edit',
     },
     },
     ...params,
     ...params,

+ 1 - 1
fixtures/js-stubs/auditLogsApiEventNames.tsx

@@ -1,5 +1,5 @@
 // Could not find any strong types for this when converting to typescript
 // Could not find any strong types for this when converting to typescript
-export function AuditLogsApiEventNames(params: string[] = []): string[] {
+export function AuditLogsApiEventNamesFixture(params: string[] = []): string[] {
   return [
   return [
     ...params,
     ...params,
     'member.invite',
     'member.invite',

+ 3 - 1
fixtures/js-stubs/authProvider.tsx

@@ -1,6 +1,8 @@
 import type {AuthProvider as AuthProviderType} from 'sentry/types';
 import type {AuthProvider as AuthProviderType} from 'sentry/types';
 
 
-export function AuthProvider(params: Partial<AuthProviderType> = {}): AuthProviderType {
+export function AuthProviderFixture(
+  params: Partial<AuthProviderType> = {}
+): AuthProviderType {
   return {
   return {
     key: 'auth_provider_key',
     key: 'auth_provider_key',
     name: 'auth_provider_name',
     name: 'auth_provider_name',

+ 6 - 4
fixtures/js-stubs/authProviders.tsx

@@ -1,15 +1,17 @@
-import {AuthProvider} from 'sentry-fixture/authProvider';
+import {AuthProviderFixture} from 'sentry-fixture/authProvider';
 
 
 import type {AuthProvider as AuthProviderType} from 'sentry/types';
 import type {AuthProvider as AuthProviderType} from 'sentry/types';
 
 
-export function AuthProviders(params: AuthProviderType[] = []): AuthProviderType[] {
+export function AuthProvidersFixture(
+  params: AuthProviderType[] = []
+): AuthProviderType[] {
   return [
   return [
-    AuthProvider({
+    AuthProviderFixture({
       key: 'dummy',
       key: 'dummy',
       name: 'Dummy',
       name: 'Dummy',
       requiredFeature: 'organizations:sso-basic',
       requiredFeature: 'organizations:sso-basic',
     }),
     }),
-    AuthProvider({
+    AuthProviderFixture({
       key: 'dummy2',
       key: 'dummy2',
       name: 'Dummy SAML',
       name: 'Dummy SAML',
       requiredFeature: 'organizations:sso-saml2',
       requiredFeature: 'organizations:sso-saml2',

Some files were not shown because too many files changed in this diff