Skip to content

Commit

Permalink
added API tags
Browse files Browse the repository at this point in the history
Fixed tests
  • Loading branch information
imolorhe committed Jan 15, 2024
1 parent 42b7a87 commit 797908f
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 6 deletions.
7 changes: 6 additions & 1 deletion packages/altair-api/nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
"sourceRoot": "src",
"compilerOptions": {
"plugins": [
"@nestjs/swagger/plugin"
{
"name": "@nestjs/swagger",
"options": {
"introspectComments": true
}
}
]
}
}
2 changes: 2 additions & 0 deletions packages/altair-api/src/queries/queries.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import { Request } from 'express';
import { CreateQueryDto } from './dto/create-query.dto';
import { UpdateQueryDto } from './dto/update-query.dto';
import { QueryItem } from '@altairgraphql/db';
import { ApiTags } from '@nestjs/swagger';

@Controller('queries')
@ApiTags('Queries')
@UseGuards(JwtAuthGuard)
export class QueriesController {
constructor(private readonly queriesService: QueriesService) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import { Request } from 'express';
import { JwtAuthGuard } from 'src/auth/guards/jwt-auth.guard';
import { CreateQueryCollectionDto } from './dto/create-query-collection.dto';
import { UpdateQueryCollectionDto } from './dto/update-query-collection.dto';
import { ApiTags } from '@nestjs/swagger';

@Controller('query-collections')
@ApiTags('Query Collections')
@UseGuards(JwtAuthGuard)
export class QueryCollectionsController {
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export class CreateTeamMembershipDto implements ICreateTeamMembershipDto {

@IsString()
@IsOptional()
@ApiProperty()
@ApiProperty({ enum: Object.keys(TeamMemberRole) })
role?: TeamMemberRole;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import { JwtAuthGuard } from 'src/auth/guards/jwt-auth.guard';
import { Request } from 'express';
import { CreateTeamMembershipDto } from './dto/create-team-membership.dto';
import { UpdateTeamMembershipDto } from './dto/update-team-membership.dto';
import { ApiTags } from '@nestjs/swagger';

@Controller('team-memberships')
@ApiTags('Team Memberships')
@UseGuards(JwtAuthGuard)
export class TeamMembershipsController {
constructor(
Expand Down
2 changes: 2 additions & 0 deletions packages/altair-api/src/teams/teams.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import { JwtAuthGuard } from 'src/auth/guards/jwt-auth.guard';
import { Request } from 'express';
import { CreateTeamDto } from './dto/create-team.dto';
import { UpdateTeamDto } from './dto/update-team.dto';
import { ApiTags } from '@nestjs/swagger';

@Controller('teams')
@ApiTags('Teams')
@UseGuards(JwtAuthGuard)
export class TeamsController {
constructor(private readonly teamsService: TeamsService) {}
Expand Down
2 changes: 2 additions & 0 deletions packages/altair-api/src/workspaces/workspaces.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import { CreateWorkspaceDto } from './dto/create-workspace.dto';
import { UpdateWorkspaceDto } from './dto/update-workspace.dto';
import { JwtAuthGuard } from 'src/auth/guards/jwt-auth.guard';
import { Request } from 'express';
import { ApiTags } from '@nestjs/swagger';

@Controller('workspaces')
@ApiTags('Workspaces')
@UseGuards(JwtAuthGuard)
export class WorkspacesController {
constructor(private readonly workspacesService: WorkspacesService) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ exports[`QueryCollectionItemComponent should render collapsed collection correct
<ul
nz-menu=""
>
<li
data-test-id="delete-query"
nz-menu-item=""
Expand Down Expand Up @@ -224,6 +225,7 @@ exports[`QueryCollectionItemComponent should render collapsed collection correct
<ul
nz-menu=""
>
<li
data-test-id="delete-query"
nz-menu-item=""
Expand Down Expand Up @@ -277,6 +279,7 @@ exports[`QueryCollectionItemComponent should render collapsed collection correct
<ul
nz-menu=""
>
<li
data-test-id="delete-query"
nz-menu-item=""
Expand Down Expand Up @@ -468,6 +471,7 @@ exports[`QueryCollectionItemComponent should render queries correctly 1`] = `
<ul
nz-menu=""
>
<li
data-test-id="delete-query"
nz-menu-item=""
Expand Down Expand Up @@ -521,6 +525,7 @@ exports[`QueryCollectionItemComponent should render queries correctly 1`] = `
<ul
nz-menu=""
>
<li
data-test-id="delete-query"
nz-menu-item=""
Expand Down Expand Up @@ -574,6 +579,7 @@ exports[`QueryCollectionItemComponent should render queries correctly 1`] = `
<ul
nz-menu=""
>
<li
data-test-id="delete-query"
nz-menu-item=""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { QueryRevisionDialogComponent } from './query-revision-dialog.component';
import { MockModule, MockProviders } from 'ng-mocks';
import { SharedModule } from '../../modules/shared/shared.module';
import { Store } from '@ngrx/store';
import { ApiService } from '../../services';

describe('QueryRevisionDialogComponent', () => {
let component: QueryRevisionDialogComponent;
let fixture: ComponentFixture<QueryRevisionDialogComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [QueryRevisionDialogComponent]
})
.compileComponents();

declarations: [QueryRevisionDialogComponent],
imports: [MockModule(SharedModule)],
providers: [MockProviders(ApiService)],
}).compileComponents();

fixture = TestBed.createComponent(QueryRevisionDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
ElectronAppService,
SubscriptionProviderRegistryService,
QueryService,
ApiService,
} from '../services';
import * as fromRoot from '../store';
import {
Expand All @@ -31,6 +32,7 @@ describe('query effects', () => {
let mockEnvironmentService: EnvironmentService;
let mockQueryService: QueryService;
let mockSubscriptionProviderRegistryService: SubscriptionProviderRegistryService;
let mockApiService: ApiService;
let mockStore: Store<RootState>;

beforeEach(() => {
Expand All @@ -43,6 +45,7 @@ describe('query effects', () => {
mockEnvironmentService = mock();
mockQueryService = mock();
mockSubscriptionProviderRegistryService = mock();
mockApiService = mock();
mockStore = mockStoreFactory();
});
describe('.convertToNamedQuery', () => {
Expand Down Expand Up @@ -72,6 +75,7 @@ describe('query effects', () => {
mockEnvironmentService,
mockQueryService,
mockSubscriptionProviderRegistryService,
mockApiService,
mockStore
);

Expand Down

0 comments on commit 797908f

Please sign in to comment.