Skip to content

Commit

Permalink
125 replace dots with underscores in filenames (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMeow authored Apr 1, 2024
2 parents b4e2399 + d9c851d commit 0165a0d
Show file tree
Hide file tree
Showing 111 changed files with 170 additions and 141 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ jobs:
uses: cypress-io/[email protected]
with:
working-directory: client
spec: cypress/e2e/**/*.cy.ts
if-no-files-found: error
spec: cypress/e2e/**/*cy.ts
browser: chrome
wait-on: 'http://localhost:5126/swagger/index.html, http://localhost:4200'
2 changes: 1 addition & 1 deletion client/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
**/infrastructure/open-api/**
# **.cy.ts // move the pattern out of the eslintrc file. this is the single point of truth
# **cy.ts // move the pattern out of the eslintrc file. this is the single point of truth
10 changes: 8 additions & 2 deletions client/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development.ts"
"with": "src/environments/environment_development.ts"
}
]
}
Expand All @@ -96,7 +96,13 @@
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json"
"tsConfig": "tsconfig.spec.json",
"include": [
"**/*spec.ts"
],
"codeCoverageExclude": [
"**/*_routes.ts"
]
}
},
"lint": {
Expand Down
1 change: 1 addition & 0 deletions client/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default defineConfig({
baseUrl: 'http://localhost:4200',
experimentalRunAllSpecs: true,
experimentalInteractiveRunEvents: true,
specPattern: 'cypress/e2e/**/*_{cy,spec}.{js,jsx,ts,tsx}',
async setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion client/src/app/app.spec.ts → client/src/app/app_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'
import { provideHttpClient } from '@angular/common/http'
import { Header, provideAppName } from 'src/app/core'
import { provideNoopAnimations } from '@angular/platform-browser/animations'
import { provideApiBaseUrlTesting } from './shared/api/provideApiBaseUrlTesting'
import { provideApiBaseUrlTesting } from './shared/api/provide_api_base_url_testing'
import { provideRouter } from '@angular/router'
import { MockComponent } from 'ng-mocks'
import { MatDrawer } from '@angular/material/sidenav'
Expand Down
2 changes: 0 additions & 2 deletions client/src/app/auth/JwtToken.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Route } from '@angular/router'
import { unauthorizedGuard } from './utils/unauthorized.guard'
import { authorizedGuard } from './utils/authorized.guard'
import { unauthorizedGuard } from './utils/unauthorized_guard'
import { authorizedGuard } from './utils/authorized_guard'

export const authRoutes: Route[] = [
{
Expand All @@ -20,7 +20,7 @@ export const authRoutes: Route[] = [
path: 'delete-chef',
canActivate: [authorizedGuard],
loadComponent: async () =>
(await import('./feature-delete-chef/delete-chef')).DeleteChef,
(await import('./feature-delete-chef/delete_chef')).DeleteChef,
title: 'Account löschen'
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { NonNullableFormBuilder, ReactiveFormsModule } from '@angular/forms'
import { MatFormFieldModule } from '@angular/material/form-field'
import { MatButtonModule } from '@angular/material/button'
import { MatIconModule } from '@angular/material/icon'
import { ChefFromControlFactory } from '../utils/ChefFormControlFactory'
import { AuthService } from '../utils/auth.service'
import { Credentials } from '../utils/Credentials'
import { ChefFromControlFactory } from '../utils/chef_form_control_factory'
import { AuthService } from '../utils/auth_service'
import { Credentials } from '../utils/credentials'
import { Router } from '@angular/router'
import { Chef } from '../utils/Chef'
import { Chef } from '../utils/chef'
import { MatInputModule } from '@angular/material/input'
import { PasswordInput } from '../ui/password/password.input'
import { PasswordInput } from '../ui/password/password_input'
import { assert } from '@common/assertions'

@Component({
selector: 'auth-delete-chef',
Expand All @@ -29,7 +30,7 @@ import { PasswordInput } from '../ui/password/password.input'
MatInputModule,
PasswordInput
],
templateUrl: './delete-chef.html',
templateUrl: './delete_chef.html',
styleUrls: ['../utils/auth.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
Expand All @@ -52,10 +53,7 @@ export class DeleteChef {
if (this.form.invalid) return

const chef: Chef | null = this.chefSignal()
if (chef === null) {
await this.router.navigateByUrl('/')
return
}
assert(chef, 'Chef may not be null.')

const credentials: Credentials = {
name: chef.name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { provideHttpClient } from '@angular/common/http'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { DeleteChef } from './delete-chef'
import { DeleteChef } from './delete_chef'
import { provideNoopAnimations } from '@angular/platform-browser/animations'
import { provideApiBaseUrlTesting } from '@api'
import { byTestAttr, setValue } from '@common/testing'
import { AuthService } from '../utils/auth_service'
import { Router } from '@angular/router'
import { MockProvider } from 'ng-mocks'

describe('DeleteChef should', () => {
let component: DeleteChef
let fixture: ComponentFixture<DeleteChef>
let authService: AuthService
let router: Router

beforeEach(async () => {
await TestBed.configureTestingModule({
Expand All @@ -17,11 +22,14 @@ describe('DeleteChef should', () => {
provideHttpClient(),
provideHttpClientTesting(),
provideNoopAnimations(),
provideApiBaseUrlTesting()
provideApiBaseUrlTesting(),
MockProvider(AuthService)
]
}).compileComponents()

fixture = TestBed.createComponent(DeleteChef)
authService = TestBed.inject(AuthService)
router = TestBed.inject(Router)
component = fixture.componentInstance
fixture.detectChanges()
})
Expand Down Expand Up @@ -54,4 +62,23 @@ describe('DeleteChef should', () => {

expect(btn.disabled).toBeFalse()
})

it('ignore onSubmit click event if from is invalid', async () => {
const comp = component as unknown as {
onSubmit(): Promise<void>
form: { invalid: boolean }
}

const removeAsyncSpy = spyOn(authService, 'removeAsync')
const onSubmitSpy = spyOn(comp, 'onSubmit')
const navigateSpy = spyOn(router, 'navigateByUrl')

expect(comp.form.invalid).toBeTrue()

await comp.onSubmit()

expect(onSubmitSpy).toHaveBeenCalled()
expect(removeAsyncSpy).not.toHaveBeenCalled()
expect(navigateSpy).not.toHaveBeenCalled()
})
})
8 changes: 4 additions & 4 deletions client/src/app/auth/feature-login/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import {
} from '@angular/forms'
import { MatIconModule } from '@angular/material/icon'
import { Router } from '@angular/router'
import { AuthService } from '../utils/auth.service'
import { AuthService } from '../utils/auth_service'
import { MatInputModule } from '@angular/material/input'
import { MatButtonModule } from '@angular/material/button'
import { ChefFromControlFactory } from '../utils/ChefFormControlFactory'
import { ChefConstraints } from '../utils/ChefConstraints'
import { PasswordInput } from '../ui/password/password.input'
import { ChefFromControlFactory } from '../utils/chef_form_control_factory'
import { ChefConstraints } from '../utils/chef_constraints'
import { PasswordInput } from '../ui/password/password_input'

@Component({
selector: 'auth-login',
Expand Down
10 changes: 5 additions & 5 deletions client/src/app/auth/feature-register/register.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
import { CommonModule } from '@angular/common'
import { AuthService } from '../utils/auth.service'
import { AuthService } from '../utils/auth_service'
import { Router } from '@angular/router'
import {
NonNullableFormBuilder,
Expand All @@ -12,10 +12,10 @@ import { MatInputModule } from '@angular/material/input'
import { MatIconModule } from '@angular/material/icon'
import { MatButtonModule } from '@angular/material/button'
import { MatTooltipModule } from '@angular/material/tooltip'
import { ChefFromControlFactory } from '../utils/ChefFormControlFactory'
import { ChefConstraints } from '../utils/ChefConstraints'
import { PasswordInput } from '../ui/password/password.input'
import { RegisterChef } from '../utils/RegisterChef'
import { ChefFromControlFactory } from '../utils/chef_form_control_factory'
import { ChefConstraints } from '../utils/chef_constraints'
import { PasswordInput } from '../ui/password/password_input'
import { RegisterChef } from '../utils/register_chef'

@Component({
selector: 'auth-register',
Expand Down
12 changes: 6 additions & 6 deletions client/src/app/auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './auth.routes'
export * from './ui/auth-corner/auth-corner'
export * from './utils/auth.interceptor'
export * from './utils/authorized.guard'
export * from './utils/Credentials'
export * from './utils/Chef'
export * from './auth_routes'
export * from './ui/auth-corner/auth_corner'
export * from './utils/auth_interceptor'
export * from './utils/authorized_guard'
export * from './utils/credentials'
export * from './utils/chef'
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import {
import { CommonModule } from '@angular/common'
import { RouterLink } from '@angular/router'
import { MatButtonModule } from '@angular/material/button'
import { AuthService } from '../../utils/auth.service'
import { AuthService } from '../../utils/auth_service'

@Component({
selector: 'auth-corner',
standalone: true,
imports: [CommonModule, MatButtonModule, RouterLink],
templateUrl: './auth-corner.html',
styleUrl: './auth-corner.scss',
templateUrl: './auth_corner.html',
styleUrl: './auth_corner.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AuthCorner {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'
import { provideHttpClient } from '@angular/common/http'
import { provideHttpClientTesting } from '@angular/common/http/testing'

import { AuthCorner } from './auth-corner'
import { AuthService } from '../../utils/auth.service'
import { AuthCorner } from './auth_corner'
import { AuthService } from '../../utils/auth_service'
import { provideRouter } from '@angular/router'
import { MockProvider } from 'ng-mocks'
import { byTestAttr } from '@common/testing'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'
import { provideHttpClient } from '@angular/common/http'
import { provideHttpClientTesting } from '@angular/common/http/testing'

import { AuthCorner } from './auth-corner'
import { AuthService } from '../../utils/auth.service'
import { AuthCorner } from './auth_corner'
import { AuthService } from '../../utils/auth_service'
import { Router, provideRouter } from '@angular/router'
import { MockProvider } from 'ng-mocks'
import { byTestAttr } from '@common/testing'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import { MatInputModule } from '@angular/material/input'
MatInputModule,
MatButtonModule
],
templateUrl: './password.input.html',
styleUrl: './password.input.scss',
templateUrl: './password_input.html',
styleUrl: './password_input.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PasswordInput {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'

import { PasswordInput } from './password.input'
import { PasswordInput } from './password_input'
import { provideNoopAnimations } from '@angular/platform-browser/animations'
import { FormControl } from '@angular/forms'
import { byTestAttr } from '@common/testing'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { firstValueFrom } from 'rxjs'

import { Credentials } from '@auth'
import { BaseApi } from '@api'
import { RegisterChef } from './RegisterChef'
import { ChefDto } from './ChefDto'
import { JwtToken } from '../JwtToken'
import { RegisterChef } from './register_chef'
import { ChefDto } from './chef_dto'
import { JwtToken } from './jwt_token'

export abstract class AuthApi extends BaseApi {
private readonly URL = this.BASE_URL + '/Auth/'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HttpInterceptorFn } from '@angular/common/http'
import { inject } from '@angular/core'
import { TokenStorage } from './token.storage'
import { TokenStorage } from './token_storage'
import { environment } from 'src/environments/environment'

export const authInterceptor: HttpInterceptorFn = (req, next) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
provideHttpClient
} from '@angular/common/http'

import { authInterceptor } from './auth.interceptor'
import { authInterceptor } from './auth_interceptor'
import { firstValueFrom, of } from 'rxjs'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { API_BASE_URL } from '@api'
import { TokenStorage } from './token.storage'
import { TokenStorage } from './token_storage'

describe('authInterceptor should', () => {
const interceptor: HttpInterceptorFn = (req, next) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import {
inject,
signal
} from '@angular/core'
import { Credentials } from './Credentials'
import { Chef } from './Chef'
import { JwtDecoder } from './jwt-decoder'
import { DecodedToken } from './DecodedToken'
import { AuthApi } from './auth.api'
import { RegisterChef } from './RegisterChef'
import { JwtToken } from '../JwtToken'
import { Credentials } from './credentials'
import { Chef } from './chef'
import { JwtDecoder } from './jwt_decoder'
import { DecodedToken } from './decoded_token'
import { AuthApi } from './auth_api'
import { RegisterChef } from './register_chef'
import { JwtToken } from './jwt_token'
import { assert } from '@common/assertions'

@Injectable({ providedIn: 'root' })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TestBed } from '@angular/core/testing'
import { AuthService } from './auth.service'
import { AuthService } from './auth_service'
import {
HttpTestingController,
provideHttpClientTesting
Expand All @@ -8,9 +8,9 @@ import { provideHttpClient } from '@angular/common/http'
import { API_BASE_URL, provideApiBaseUrlTesting } from '@api'
import { WritableSignal, isSignal } from '@angular/core'
import { MockProvider } from 'ng-mocks'
import { TokenStorage } from './token.storage'
import { TokenStorage } from './token_storage'
import { Chef } from '@auth'
import { RegisterChef } from './RegisterChef'
import { RegisterChef } from './register_chef'

describe('AuthService', () => {
let authService: AuthService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { inject } from '@angular/core'
import { CanActivateFn } from '@angular/router'
import { AuthService } from './auth.service'
import { AuthService } from './auth_service'
import { FeedbackService } from '@shared/feedback'

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
CanActivateFn,
RouterStateSnapshot
} from '@angular/router'
import { authorizedGuard } from './authorized.guard'
import { authorizedGuard } from './authorized_guard'
import { provideHttpClient } from '@angular/common/http'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { provideNoopAnimations } from '@angular/platform-browser/animations'
import { AuthService } from './auth.service'
import { AuthService } from './auth_service'
import { signal } from '@angular/core'

describe('authorized guard should', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DecodedToken } from './DecodedToken'
import { TokenKey } from './TokenKey'
import { DecodedToken } from './decoded_token'
import { TokenKey } from './token_key'

export class Chef {
constructor(decodedToken: DecodedToken) {
Expand Down
File renamed without changes.
Loading

0 comments on commit 0165a0d

Please sign in to comment.