Skip to content

Commit

Permalink
Merge branch 'master' into write-tests-case-for-wanted
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtabBukhari authored Feb 14, 2024
2 parents 5978aea + 1ea5e29 commit 8b398d9
Show file tree
Hide file tree
Showing 98 changed files with 4,375 additions and 1,530 deletions.
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ A clear and concise description of what you expected to happen.
### Acceptance Criteria
- [ ] I have tested on Chrome desktop
- [ ] I have posted a screenshot or video in my PR
- [ ] I have rebased and tested locally before submitting my PR

Here is an [example unit test](https://github.com/stakwork/sphinx-tribes/blob/master/frontend/app/src/helpers/__test__/helpers.spec.ts)
Here is an [example component test](https://github.com/stakwork/sphinx-tribes/blob/9310f49b3b17a51992dada932f4298eb9eba15ff/frontend/app/src/people/widgetViews/__tests__/AboutView.spec.tsx)
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ assignees: ''
### Acceptance Criteria
- [ ] I've tested on Chrome
- [ ] I've submitted a screenshot or recording in my pr
- [ ] I've created a unit test that
- [ ] I've created a test that
- [ ] I have rebased and tested locally before submitting my PR

Here is an [example unit test](https://github.com/stakwork/sphinx-tribes/blob/master/frontend/app/src/helpers/__test__/helpers.spec.ts)

Expand Down
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/test-tickets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Test tickets
about: Template to create tests
title: ''
labels: Bounties
assignees: ''

---

### Context


### File to to test


### File to create


### Acceptance Criteria
- [ ] I have rebased and tested locally before submitting my PR

### References
- Watch this [Jest Youtube playlist](https://www.youtube.com/watch?v=T2sv8jXoP4s&list=PLC3y8-rFHvwirqe1KHFCHJ0RqNuN61SJd) if you are new to testing
- Here is an [example unit test](https://github.com/stakwork/sphinx-tribes/blob/master/frontend/app/src/helpers/__test__/helpers.spec.ts)
- Here is an [example component test](https://github.com/stakwork/sphinx-tribes/blob/9310f49b3b17a51992dada932f4298eb9eba15ff/frontend/app/src/people/widgetViews/__tests__/AboutView.spec.tsx)
56 changes: 56 additions & 0 deletions .github/workflows/build_on_master_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Docker build on push (master)
env:
DOCKER_CLI_EXPERIMENTAL: enabled

on:
push:
branch:
- master

# https://docs.github.com/en/actions/learn-github-actions/expressions
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
concurrency:
# github.workflow: name of the workflow
# github.event.pull_request.number || github.ref: pull request number or branch name if not a pull request
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

# Cancel in-progress runs when a new workflow with the same group name is triggered
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04
name: Build and push Tribes image (master)
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Check out from Git
uses: actions/checkout@v2
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Checkout project
uses: actions/checkout@v2
- name: Setup Docker buildx action
uses: crazy-max/ghaction-docker-buildx@v1
id: buildx
with:
buildx-version: latest
qemu-version: latest
- name: Cache Docker layers
uses: actions/cache@v2
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Run Docker buildx
run: |
docker buildx build \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--platform linux/amd64,linux/arm/v7 \
--tag "${{ secrets.DOCKER_HUB_USER }}/sphinx-tribes-frontend:master" \
--output "type=registry" ./
8 changes: 0 additions & 8 deletions .hintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

cd frontend/app && yarn run lint
yarn run lint
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /usr/src/app

COPY package.json ./
COPY yarn.lock ./
RUN yarn install
RUN yarn install --production

COPY . .

Expand Down
24 changes: 24 additions & 0 deletions cypress/e2e/create_bounty.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
describe('Alice tries to create a bounty', () => {
it('Create a bounty', () => {
let activeUser = 'alice';
cy.login(activeUser);
cy.wait(1000);

cy.create_bounty({
title: 'My new Bounty',
category: 'Web development',
coding_language: ['Typescript', 'Javascript', 'Lightning'],
description: 'This is available',
amount: '123',
assign: 'carol',
deliverables: 'We are good to go man',
tribe: '',
estimate_session_length: 'Less than 3 hour',
estimate_completion_date: '09/09/2024'
});

cy.wait(1000);

cy.logout(activeUser);
});
});
15 changes: 15 additions & 0 deletions cypress/e2e/create_org.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
describe('Create Organization', () => {
it('Creating an Organization', () => {
cy.login('carol');

cy.create_org({
loggedInAs: 'carol',
name: 'New Organization 8',
description: 'We are testing out our oeganization',
website: 'https://community.sphinx.chat',
github: 'https://github.com/stakwork/sphinx-tribes-frontend'
});

cy.logout('carol');
});
});
11 changes: 11 additions & 0 deletions cypress/e2e/lnurl_login.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// LNURL PublicKey
// 0430a9b0f2a0bad383b1b3a1989571b90f7486a86629e040c603f6f9ecec857505fd2b1279ccce579dbe59cc88d8d49b7543bd62051b1417cafa6bb2e4fd011d30

describe('Login with LNURL', () => {
it('User trying to login with LNURL', () => {
cy.lnurl_login();

cy.wait(1000);
cy.logout('0430'); // NOTE: to logout LNURL auth use the first for letters of the pubkey as the userAlias.
});
});
59 changes: 0 additions & 59 deletions cypress/e2e/login.cy.ts

This file was deleted.

53 changes: 53 additions & 0 deletions cypress/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
declare namespace Cypress {
interface Chainable {
login(userAlias: string): void;
logout(userAlias: string): void;
create_bounty(bounty: Bounty): void;
lnurl_login(): void;
create_org(Organization: Organization): void;
pay_invoice(details: InvoiceDetail): void;
}

type Category =
| 'Web development'
| 'Mobile development'
| 'Design'
| 'Desktop app'
| 'Dev ops'
| 'Bitcoin / Lightning'
| 'Other';

type EstimateSessionLength =
| 'Less than 1 hour'
| 'Less than 3 hour'
| 'More than 3 hour'
| 'Not sure yet';

type Bounty = {
organization?: string;
title: string;
github_issue_url?: string;
category: Category;
coding_language?: string[];
description: string;
amount: string;
tribe?: string;
estimate_session_length?: EstimateSessionLength;
estimate_completion_date?: string; // MM/DD/YYYY
deliverables?: string;
assign?: string;
};

type Organization = {
loggedInAs: string;
name: string;
description: string;
website?: string;
github?: string;
};

type InvoiceDetail = {
payersName: string;
invoice: string;
};
}
Loading

0 comments on commit 8b398d9

Please sign in to comment.