Skip to content

Commit

Permalink
refactor: base layout of new version
Browse files Browse the repository at this point in the history
  • Loading branch information
valerymelou committed Apr 21, 2024
1 parent faf480a commit 3aa931f
Show file tree
Hide file tree
Showing 74 changed files with 1,478 additions and 938 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

# Connect your workspace on nx.app and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
# - run: yarn nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
- run: yarn nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"

# Cache node_modules
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion apps/portfolio/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<app-nx-welcome></app-nx-welcome> <router-outlet></router-outlet>
<router-outlet></router-outlet>
25 changes: 10 additions & 15 deletions apps/portfolio/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
import { TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { NxWelcomeComponent } from './nx-welcome.component';
import { RouterTestingModule } from '@angular/router/testing';
import { RouterModule } from '@angular/router';

describe('AppComponent', () => {
let fixture: ComponentFixture<AppComponent>;
let app: AppComponent;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AppComponent, NxWelcomeComponent, RouterTestingModule],
imports: [AppComponent, RouterModule],
}).compileComponents();
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture = TestBed.createComponent(AppComponent);
app = fixture.componentInstance;
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain(
'Welcome portfolio'
);
});

it(`should have as title 'portfolio'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('portfolio');
it('should create', () => {
expect(app).toBeTruthy();
});
});
7 changes: 2 additions & 5 deletions apps/portfolio/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';
import { NxWelcomeComponent } from './nx-welcome.component';

@Component({
standalone: true,
imports: [NxWelcomeComponent, RouterModule],
imports: [RouterModule],
selector: 'app-root',
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
})
export class AppComponent {
title = 'portfolio';
}
export class AppComponent {}
19 changes: 18 additions & 1 deletion apps/portfolio/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
import { Route } from '@angular/router';
import { BaseLayoutComponent } from '@valerymelou/shared/layout';
import { themeResolver } from '@valerymelou/core/theming';

export const appRoutes: Route[] = [];
export const appRoutes: Route[] = [
{
path: '',
component: BaseLayoutComponent,
resolve: {
theme: themeResolver,
},
children: [
{
path: '',
loadComponent: () =>
import('@valerymelou/pages/about').then((c) => c.AboutComponent),
},
],
},
];
Loading

0 comments on commit 3aa931f

Please sign in to comment.