Skip to content

Instantly share code, notes, and snippets.

"targets": {
"openapi": {
"executor": "nx:run-commands",
"options": {
"commands": [
"npx ng-openapi-gen -c ng-openapi-gen.json",
"yarn format"
],
"cwd": "libs/myorg/shared/api",
"parallel": false
{
"$schema": "node_modules/ng-openapi-gen/ng-openapi-gen-schema.json",
"input": "myorg_api.yaml",
"output": "./src/lib",
"serviceSuffix": "ApiService",
"module": "MyorgSharedApiModule",
"configuration": "MyorgSharedApiConfiguration"
}
openapi: 3.0.0
x-stoplight:
id: qjnljykf3473n
info:
title: login
version: '1.0'
description: Post login
servers:
- url: 'https://local-myorg.com:4200/'
description: local
import { Environment, MYORG_APP_CONFIG } from '@myorg/myorg/shared';
constructor(@Inject(MYORG_APP_CONFIG) config: Environment) {
console.log('environment -> ', config);
}
<div style="display: flex; height: 100vh; flex-direction: column;">
<div style="flex: none;">
ここは高さを指定
</div>
<div style="flex: 1 1 auto; overflow: auto;">
<!-- 入れ子のサンプル -->
<div style="display: flex; height: 100%; flex-direction: column;">
<div style="flex: none;">
ここは高さを指定
</div>
@ksakae1216
ksakae1216 / flex
Last active January 7, 2023 07:04
<div style="display: flex; height: 100vh; flex-direction: column;">
<div style="flex: none;">
ここは高さを指定
</div>
<div style="flex: 1 1 auto; overflow: auto;">
ここは残りの領域を埋めてくれる
</div>
</div>
describe('LoginFormComponent', () => {
it('should display required error message', () => {
setup();
cy.get('input[name=loginId]').click();
cy.get('[data-cy="password"]').click({force: true});
cy.get('mat-error').should('contain', 'ログインIDを入力してください');
});
});
nx g @nrwl/angular:cypress-component-configuration --project=your-project
nx g @nrwl/angular:cypress-component-project --project=my-cool-angular-project
it('should call SampleContainerComponent.submitAction()', () => {
jest.spyOn(container, 'submitAction');
// 子Componentのemit
(fixture.debugElement.query(By.directive(SampleComponent)).componentInstance as SampleComponent).submitAction.emit();
// 親Containerのmethodがcallされてるかテスト
expect(container.submitAction).toHaveBeenCalledWith();
})