Skip to content

Commit

Permalink
🃏 ui tests pipeline
Browse files Browse the repository at this point in the history
ui tests pipeline
  • Loading branch information
petar-cvit authored Mar 16, 2024
2 parents 1ca1432 + 493c7d9 commit bc17e81
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/controller-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Controller tests
name: controller tests

on:
push:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/ui-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: ui tests

on:
push:
paths:
- 'cyclops-ui/**'

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2

- name: Install dependencies
run: |
cd ${{ github.workspace }}/cyclops-ui
npm install --force
- name: Run tests
run: |
cd ${{ github.workspace }}/cyclops-ui
npm test
4 changes: 2 additions & 2 deletions .github/workflows/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
deploy:
name: Deploy to GitHub Pages
name: deploy to GitHub pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -23,7 +23,7 @@ jobs:
npm ci
npm run build
- name: Deploy to GitHub Pages
- name: deploy to GitHub pages
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
Expand Down
9 changes: 0 additions & 9 deletions cyclops-ui/src/App.test.tsx

This file was deleted.

40 changes: 40 additions & 0 deletions cyclops-ui/src/utils/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {fileExtension} from "./form";

describe("fileExtension", () => {
const testCases = [
{
in: "json",
out: "json"
},
{
in: "sh",
out: "sh"
},
{
in: "yaml",
out: "yaml"
},
{
in: "toml",
out: "toml"
},
{
in: "javascript",
out: "javascript"
},
{
in: "typescript",
out: "typescript"
},
{
in: "what",
out: "text"
},
]

it("returns correct code highlight to text type", () => {
for (let i = 0; i < testCases.length; i++) {
expect(testCases[i].out).toBe(fileExtension(testCases[i].in))
}
})
});

0 comments on commit bc17e81

Please sign in to comment.