-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from shanedg/dev
dev: client improvements, new features, and fixes
- Loading branch information
Showing
55 changed files
with
3,637 additions
and
2,943 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Type Check | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
type-check: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Restore Build Cache | ||
id: restore-build-cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
~/.cache/Cypress | ||
common/temp | ||
*/.rush/temp | ||
*/node_modules | ||
*/dist | ||
key: ${{ runner.os }}-build-${{ hashFiles('common/config/rush/repo-state.json') }} | ||
fail-on-cache-miss: true | ||
|
||
- name: Configure Discord Secrets | ||
run: (cd discord && ./client_config_ci.sh) | ||
env: | ||
# Any values will do, discord application does not run during this job | ||
DISCORD_CLIENT_ID: fake_discord_client_id | ||
DISCORD_CLIENT_SECRET: fake_discord_client_secret | ||
DISCORD_GUILD_ID: fake_guild_id | ||
DISCORD_SESSION_SECRET: fake_discord_session_secret | ||
DISCORD_REDIRECT_URI: fake_discord_redirect_uri | ||
|
||
- name: Type Check | ||
run: node common/scripts/install-run-rush.js type-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
cypress/screenshots | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ npm run lint | |
Run `Jest` tests. | ||
|
||
```bash | ||
npm run test:jest | ||
npm run test | ||
``` | ||
|
||
## Type Check | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-project.schema.json", | ||
"operationSettings": [ | ||
{ | ||
"operationName": "build", | ||
"outputFolderNames": ["dist"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,35 @@ | ||
describe('client', () => { | ||
it('renders', () => { | ||
describe('app', () => { | ||
it('visits home', () => { | ||
cy.visit('/'); | ||
cy.get('#root > h1') | ||
.should('have.text', 'trshcmpctr'); | ||
|
||
cy.get('#root h1').should('have.text', 'trshcmpctr'); | ||
cy.get('#root p').should('have.text', | ||
'welcome to the trash compactor, <mocked_user_name>'); | ||
}); | ||
|
||
it('navigates to new', () => { | ||
cy.visit('/'); | ||
cy.get('a[href="/new"]').click(); | ||
|
||
cy.get('h2').should('have.text', 'new'); | ||
cy.get('form').within(() => { | ||
cy.get('select').should('have.text', '1.20.1'); | ||
}); | ||
}); | ||
|
||
it('navigates to worlds', () => { | ||
cy.visit('/'); | ||
cy.get('a[href="/worlds"]').click(); | ||
|
||
cy.get('h2').should('have.text', 'worlds'); | ||
cy.get('thead > tr > td:first-child').should('have.text', 'name'); | ||
}); | ||
|
||
it('navigates to a world', () => { | ||
cy.visit('/'); | ||
cy.get('a[href="/worlds"]').click(); | ||
cy.get('a[href="/worlds/1"]').click(); | ||
|
||
cy.get('h3').should('have.text', '1'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
a { | ||
color: aqua; | ||
} | ||
|
||
a:visited { | ||
color: blueviolet; | ||
} | ||
|
||
.navigation-list { | ||
list-style-type: none; | ||
display: inline-flex; | ||
} | ||
|
||
.navigation-list li { | ||
padding-right: 6px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
import { | ||
render, | ||
screen, | ||
waitFor, | ||
} from '@testing-library/react'; | ||
import React from 'react'; | ||
|
||
import App from './App'; | ||
import { App } from './App'; | ||
|
||
describe('App', () => { | ||
it('renders a heading', () => { | ||
it('renders a heading', async () => { | ||
render(<App />); | ||
expect(screen.getByRole('heading')).toHaveTextContent('trshcmpctr'); | ||
await waitFor( | ||
() => expect(screen.getByRole('heading')).toHaveTextContent('trshcmpctr') | ||
); | ||
}); | ||
}); |
Oops, something went wrong.