From 29e97b9af12ef5d54df6d07bcdc26203aaee50d0 Mon Sep 17 00:00:00 2001 From: Malin Antonsson Date: Wed, 14 Sep 2022 14:27:31 +0200 Subject: [PATCH] feat: generate new nx application --- .../cypress.config.ts | 6 + .../src/e2e/app.cy.ts | 13 + .../src/fixtures/example.json | 4 + .../src/support/e2e.ts | 17 + .../src/app/app.spec.tsx | 17 + .../src/app/nx-welcome.tsx | 820 ++++++++++++++++++ 6 files changed, 877 insertions(+) create mode 100644 apps/liquidity-provision-dashboard-e2e/cypress.config.ts create mode 100644 apps/liquidity-provision-dashboard-e2e/src/e2e/app.cy.ts create mode 100644 apps/liquidity-provision-dashboard-e2e/src/fixtures/example.json create mode 100644 apps/liquidity-provision-dashboard-e2e/src/support/e2e.ts create mode 100644 apps/liquidity-provision-dashboard/src/app/app.spec.tsx create mode 100644 apps/liquidity-provision-dashboard/src/app/nx-welcome.tsx diff --git a/apps/liquidity-provision-dashboard-e2e/cypress.config.ts b/apps/liquidity-provision-dashboard-e2e/cypress.config.ts new file mode 100644 index 000000000..22f7c84eb --- /dev/null +++ b/apps/liquidity-provision-dashboard-e2e/cypress.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from 'cypress'; +import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; + +export default defineConfig({ + e2e: nxE2EPreset(__dirname), +}); diff --git a/apps/liquidity-provision-dashboard-e2e/src/e2e/app.cy.ts b/apps/liquidity-provision-dashboard-e2e/src/e2e/app.cy.ts new file mode 100644 index 000000000..650e48e51 --- /dev/null +++ b/apps/liquidity-provision-dashboard-e2e/src/e2e/app.cy.ts @@ -0,0 +1,13 @@ +import { getGreeting } from '../support/app.po'; + +describe('liquidity-provision-dashboard', () => { + beforeEach(() => cy.visit('/')); + + it('should display welcome message', () => { + // Custom command example, see `../support/commands.ts` file + cy.login('my-email@something.com', 'myPassword'); + + // Function helper example, see `../support/app.po.ts` file + getGreeting().contains('Welcome liquidity-provision-dashboard'); + }); +}); diff --git a/apps/liquidity-provision-dashboard-e2e/src/fixtures/example.json b/apps/liquidity-provision-dashboard-e2e/src/fixtures/example.json new file mode 100644 index 000000000..294cbed6c --- /dev/null +++ b/apps/liquidity-provision-dashboard-e2e/src/fixtures/example.json @@ -0,0 +1,4 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io" +} diff --git a/apps/liquidity-provision-dashboard-e2e/src/support/e2e.ts b/apps/liquidity-provision-dashboard-e2e/src/support/e2e.ts new file mode 100644 index 000000000..3d469a6b6 --- /dev/null +++ b/apps/liquidity-provision-dashboard-e2e/src/support/e2e.ts @@ -0,0 +1,17 @@ +// *********************************************************** +// This example support/index.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands'; diff --git a/apps/liquidity-provision-dashboard/src/app/app.spec.tsx b/apps/liquidity-provision-dashboard/src/app/app.spec.tsx new file mode 100644 index 000000000..543979087 --- /dev/null +++ b/apps/liquidity-provision-dashboard/src/app/app.spec.tsx @@ -0,0 +1,17 @@ +import { render } from '@testing-library/react'; + +import App from './app'; + +describe('App', () => { + it('should render successfully', () => { + const { baseElement } = render(); + + expect(baseElement).toBeTruthy(); + }); + + it('should have a greeting as the title', () => { + const { getByText } = render(); + + expect(getByText(/Welcome liquidity-provision-dashboard/gi)).toBeTruthy(); + }); +}); diff --git a/apps/liquidity-provision-dashboard/src/app/nx-welcome.tsx b/apps/liquidity-provision-dashboard/src/app/nx-welcome.tsx new file mode 100644 index 000000000..5e1ba69e5 --- /dev/null +++ b/apps/liquidity-provision-dashboard/src/app/nx-welcome.tsx @@ -0,0 +1,820 @@ +/* + * * * * * * * * * * * * * * * * * * * * * * * * * * * * + This is a starter component and can be deleted. + * * * * * * * * * * * * * * * * * * * * * * * * * * * * + Delete this file and get started with your project! + * * * * * * * * * * * * * * * * * * * * * * * * * * * * + */ +export function NxWelcome({ title }: { title: string }) { + return ( + <> +