Skip to content

Commit

Permalink
Merge pull request #13 from fabianbormann/develop
Browse files Browse the repository at this point in the history
chore: merge develop
  • Loading branch information
fabianbormann authored May 7, 2023
2 parents 0f7691b + de99f13 commit 90cf137
Show file tree
Hide file tree
Showing 10 changed files with 1,921 additions and 64 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run Tests
on:
push:
branches-ignore:
- 'main'
pull_request:
branches-ignore:
- 'main'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3

- name: 🫡 Setup node
uses: actions/setup-node@v1
with:
node-version: 16

- name: 🧘‍♀️ Download dependencies
run: npm ci

- name: 🎳 Run tests
run: npm test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

# testing
/coverage
cypress/videos
cypress/screenshots

# production
/build
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cardano Node Ui

<p align="left">

<img alt="Test" src="https://img.shields.io/github/actions/workflow/status/fabianbormann/cardano-node-ui/test.yml?label=Test&style=for-the-badge" />
<img alt="Release" src="https://img.shields.io/github/actions/workflow/status/fabianbormann/cardano-node-ui/release.yml?label=Release&style=for-the-badge" />
<img alt="Build" src="https://img.shields.io/github/actions/workflow/status/fabianbormann/cardano-node-ui/build.yml?label=Build&style=for-the-badge" />
<a href="https://conventionalcommits.org"><img alt="conventionalcommits" src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&style=for-the-badge" /></a>
Expand All @@ -11,7 +11,6 @@ This project aims to provide a streamlined, single-click ui solution for launchi

<img src="https://user-images.githubusercontent.com/1525818/232276588-89c5288d-42a6-4820-975b-7e2c25cf75da.png" width="75%"/>


## 📌 Download Latest Release

📦 Cardano Node Ui v0.1.4
Expand Down
9 changes: 9 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
44 changes: 44 additions & 0 deletions cypress/e2e/dashboard.spec.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/// <reference types="cypress" />

describe('dashboard spec', () => {
before(() => {
cy.visit('http://localhost:3000').then(() =>
cy.window().then((window) => {
(window as any).electron = {
getDefaultDirectory: async () => {
return '/Users/suomynona/.cardano-node-ui';
},
getSocketPath: (directory: string, selectedNetwork: string) => {
const databaseDirectory = `${directory}/${selectedNetwork}-db`;
const socketPath = `${databaseDirectory}/node.socket`;

return `export CARDANO_NODE_SOCKET_PATH="${socketPath}"`;
},
};
})
);
});

it('should switch the network and adjust the node.socket path', () => {
cy.get('[data-testid="network-selector-input"]').should(
'have.value',
'mainnet'
);
cy.get('[data-testid="socket-path-field"]')
.find('input')
.invoke('val')
.should('include', 'mainnet-db');

cy.get('[data-testid="network-selector"]').click();
cy.get('[data-testid="network-option-preprod"]').click({ force: true });

cy.get('[data-testid="network-selector-input"]').should(
'have.value',
'preprod'
);
cy.get('[data-testid="socket-path-field"]')
.find('input')
.invoke('val')
.should('include', 'preprod-db');
});
});
37 changes: 37 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
20 changes: 20 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.ts 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';

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading

0 comments on commit 90cf137

Please sign in to comment.