Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ekdnam test readme #147

Open
wants to merge 62 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
59fab83
setup tests
justinnguyen0 Nov 11, 2023
96455bc
Merge pull request #1 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 11, 2023
262cb0b
setup tests
justinnguyen0 Nov 11, 2023
c6b3b9f
Merge pull request #2 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 11, 2023
5c46a91
add first test
justinnguyen0 Nov 11, 2023
3ad97dc
Merge pull request #3 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 11, 2023
c1b434e
add more tests
justinnguyen0 Nov 12, 2023
f3ff5db
Merge pull request #4 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 12, 2023
702926d
add more tests
justinnguyen0 Nov 12, 2023
a2f64f4
Merge pull request #5 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 12, 2023
bab8692
CI-CD Workflow
kashishvjain Nov 12, 2023
2f64f75
Update test.yml
kashishvjain Nov 12, 2023
4ec4c04
Merge pull request #10 from CSE-210-Team-6/kashishvjain-patch-1
kashishvjain Nov 12, 2023
99b77d0
add more tests
justinnguyen0 Nov 12, 2023
1009b78
Merge pull request #12 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 12, 2023
534f92f
refactor for jest to pass
justinnguyen0 Nov 12, 2023
0e777db
Merge pull request #13 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 12, 2023
1453359
add more tests for storage.js
justinnguyen0 Nov 12, 2023
e8658aa
Merge pull request #14 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 12, 2023
df85684
add more tests for storage.js
justinnguyen0 Nov 12, 2023
51f643d
Merge pull request #15 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 13, 2023
3741ace
test: add tests for notes.js
Melody-Creator Nov 13, 2023
c741d6a
Merge pull request #16 from CSE-210-Team-6/test
Melody-Creator Nov 16, 2023
66fa56d
Kashish reformat (#17)
kashishvjain Nov 17, 2023
2847b55
add more tests
justinnguyen0 Nov 18, 2023
cca7681
Merge pull request #18 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 18, 2023
f83d0f5
Add files via upload
sora1998 Nov 18, 2023
b8895dd
Add files via upload
sora1998 Nov 18, 2023
4bd52aa
refactor: added JS Docs
Melody-Creator Nov 18, 2023
5d8dfd6
Merge pull request #19 from CSE-210-Team-6/enze
sora1998 Nov 18, 2023
90f442e
Merge pull request #20 from CSE-210-Team-6/ever-reformat
Melody-Creator Nov 18, 2023
6b756b8
add jsdocs
ekdnam Nov 18, 2023
3bae377
add basicauth object
ekdnam Nov 18, 2023
5f92df8
refactor account.js
ekdnam Nov 18, 2023
206e1dc
add jsdocs to webfiger.js
ekdnam Nov 18, 2023
0ba959e
camel case
ekdnam Nov 18, 2023
bc78dfe
aditya-refactor
ekdnam Nov 18, 2023
7469933
add comments and refactor
Tigojiang Nov 23, 2023
e766ff5
add more tests for account
justinnguyen0 Nov 26, 2023
edc1c53
Merge pull request #23 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 26, 2023
58577cc
Code standardization (#24)
smruthig Nov 26, 2023
b921244
add more tests for account
justinnguyen0 Nov 28, 2023
93f148f
Merge pull request #25 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 28, 2023
6e87527
Delete public/.DS_Store
ekdnam Nov 28, 2023
aaf44ee
Merge pull request #26 from CSE-210-Team-6/ekdnam-patch-1
ekdnam Nov 28, 2023
538dc3b
fix pref display bug and add default image
Tigojiang Nov 30, 2023
96fe504
add more test for account
justinnguyen0 Nov 30, 2023
e82d78d
Merge pull request #29 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 30, 2023
a0287c2
update profile username
Tigojiang Nov 30, 2023
f26414c
Merge branch 'main' of https://github.com/CSE-210-Team-6/shuttlecraft
Tigojiang Nov 30, 2023
bfe522d
update (#28)
sora1998 Nov 30, 2023
d76dbc9
Merge pull request #30 from CSE-210-Team-6/main
sora1998 Nov 30, 2023
5af5216
add more tests for account
justinnguyen0 Nov 30, 2023
6907c12
Merge pull request #31 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 30, 2023
6a6704d
add more tests
justinnguyen0 Nov 30, 2023
1a30831
Merge pull request #32 from CSE-210-Team-6/justin-tests
justinnguyen0 Nov 30, 2023
54be768
feat:supported adding bio
Melody-Creator Nov 30, 2023
69923f1
Merge pull request #33 from CSE-210-Team-6/ever-bio
Melody-Creator Nov 30, 2023
3c5eeb0
avatar change
sora1998 Nov 30, 2023
9056675
Merge pull request #34 from CSE-210-Team-6/enze
sora1998 Nov 30, 2023
8b81074
Added test Coverage Checks (#35)
kashishvjain Dec 1, 2023
1fc01f8
cse 210 roxx
ekdnam Dec 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ module.exports = {
sourceType: 'module'
},
rules: {
}
},
ignorePatterns: ["**/*.jest.js"],
}
31 changes: 31 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Running Code Coverage

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 16.x]

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run tests
run: npm run test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Unit Tests

on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 16.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,5 @@ To block users or instances:
- Add an entry to the file at `.data/blocks`
- You can block a user using their actor ID (something like https://foo.bar/@jerk) or their entire domain (https://foo.bar/)
- Restart the app

CSE 210 ROXXX
3 changes: 3 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [['@babel/preset-env', {targets: {node: 'current'}}]],
};
12 changes: 12 additions & 0 deletions compose-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
app:
entrypoint:
- sleep
- infinity
image: docker/dev-environments-javascript:stable-1
init: true
volumes:
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock

81 changes: 44 additions & 37 deletions design/dashboard.handlebars
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
<div class="stream">
<header>
<span>{{prefs.icons.latest}} Latest</span>
<a href="/private" id="newPosts" class="unread" hidden></a>
</header>
<div id="home_stream">
{{#if activitystream}}
{{#each activitystream}}
{{#with this}}
<div class="activity">
{{#if boost}}
<div class="boost">
🚀 boosted by <a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</div>
{{/if}}
{{> note note=note me=../me}}
</div>
{{/with}}
{{/each}}
{{else}}
<div class="empty">
<p>Follow some people to fill your feed with posts.</p>
<p>I suggest following me!
I'm <a href="/private/feeds/[email protected]">[email protected]</a>
</p>
</div>
<header class="stream-header">
<span>{{prefs.icons.latest}} Latest</span>
<a href="/private" id="newPosts" class="unread-link" hidden></a>
</header>
<main id="home_stream">
{{#if activitystream}}
{{#each activitystream}}
<article class="activity">
{{#with this}}
{{#if boost}}
<section class="boost-notification">
🚀 Boosted by
<a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</section>
{{/if}}
{{> note note=note me=../me}}
{{/with}}
</article>
{{/each}}
{{else}}
<div class="empty-state">
<p>Follow some people to fill your feed with posts.</p>
<p>Suggestion: Follow
<a href="/private/feeds/[email protected]">[email protected]</a>
</p>
</div>
{{/if}}
</main>

{{#if next}}
<footer>
<a href="/private?offset={{next}}" class="more-link">More</a>
</footer>
{{/if}}
</div>


{{#if next}}
<a href="/private?offset={{next}}" class="moreLink">More</a>
{{/if}}
</div>
<script>
// take note of the most recent post date
{{#isEq offset "0"}}
{{#each ../activitystream}} {{#if @first}}
app.latestPost("{{or this.boost.published this.note.published}}");
{{/if}}{{/each}}
{{/isEq}}
app.pollForPosts();
document.addEventListener('DOMContentLoaded', () => {
// Take note of the most recent post date
{{#isEq offset "0"}}
{{#each ../activitystream}}
{{#if @first}}
app.latestPost("{{or this.boost.published this.note.published}}");
{{/if}}
{{/each}}
{{/isEq}}
app.pollForPosts();
});
</script>
63 changes: 37 additions & 26 deletions design/dms.handlebars
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
{{#if error}}
<div class="error">
{{error.message}}
</div>
{{else}}
<div class="stream">
{{#if feed}}
<header><a href="/private/dms">Inbox</a> &raquo; Messages with <a href="/private/feeds/{{getUsername feed.id}}">{{feed.preferredUsername}}</a></header>
<div class="inbox">
<div class="messages" id="inbox_stream">
{{#each inbox}}
{{> dm message=this me=../me}}
{{/each}}
</div>
{{> minicomposer inReplyTo=lastIncoming to=feed.id}}
</div>
{{else}}
<!-- TODO: empty state? -->
<div class="empty">
Select a conversation. To create a new one, navigate to a profile.
</div>
{{/if}}
</div>
{{/if}}
<article>
{{#if error}}
<aside class="notification error">
{{error.message}}
</aside>
{{else}}
<section class="stream">
{{#if feed}}
<header>
<nav>
<a href="/private/dms">Inbox</a> ›
Messages with
<a href="/private/feeds/{{getUsername feed.id}}">{{feed.preferredUsername}}</a>
</nav>
</header>
<div class="message-container">
<ul class="messages-list" id="inbox_stream">
{{#each inbox}}
<li>
{{> dm message=this me=../me}}
</li>
{{/each}}
</ul>
{{> minicomposer inReplyTo=lastIncoming to=feed.id}}
</div>
{{else}}
<div class="empty-state">
Select a conversation. To create a new one, navigate to a profile.
</div>
{{/if}}
</section>
{{/if}}
</article>
<script>
app.pollForPosts();
</script>
document.addEventListener('DOMContentLoaded', () => {
app.pollForPosts();
});
</script>
81 changes: 44 additions & 37 deletions design/feeds.handlebars
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
{{#if error}}
<div class="error">
{{error.message}}
</div>
{{else}}
<div class="stream">
{{#if feed}}
{{> profileHeader actor=feed nobio=true}}
{{/if}}
{{#if activitystream}}
{{#each activitystream}}
{{#with this}}
<div class="activity">
{{#if boost}}
<div class="boost">
🚀 boosted by <a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</div>
{{> note note=note}}
{{else}}
{{> note note=note hidebyline=true}}
{{/if}}
</div>
{{/with}}
{{/each}}
{{else}}
<!-- TODO: empty state? -->
<div class="empty">
No posts. <a href="/private/feeds/{{getUsername feed.id}}">Reload</a>
</div>
{{/if}}
<div class="content-area">
{{#if error}}
<aside class="error-message">
{{error.message}}
</aside>
{{else}}
<section class="stream">
{{#if feed}}
{{> profileHeader actor=feed nobio=true}}
{{/if}}

{{#if activitystream}}
{{#each activitystream}}
{{#with this}}
<article class="activity-post">
{{#if boost}}
<div class="boost-notice">
🚀 Boosted by
<a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</div>
{{> note note=note}}
{{else}}
{{> note note=note hidebyline=true}}
{{/if}}
</article>
{{/with}}
{{/each}}
{{else}}
<div class="empty-state">
No posts. <a href="/private/feeds/{{getUsername feed.id}}">Reload</a>
</div>
{{/if}}

{{#if next}}
<a href="?offset={{next}}" class="moreLink">More</a>
{{/if}}
{{#if next}}
<footer class="pagination">
<a href="?offset={{next}}" class="more-link">More</a>
</footer>
{{/if}}
</section>
{{/if}}
</div>

</div>
{{/if}}
<script>
app.pollForPosts();
</script>
document.addEventListener('DOMContentLoaded', () => {
app.pollForPosts();
});
</script>
41 changes: 26 additions & 15 deletions design/findresults.handlebars
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
<div class="stream">
<section class="stream">
<header>
<form method="get" action="/private/find">
<label for="lookup">Find People</label>
<input type="search" placeholder="[email protected]" id="lookup" name="handle" value="{{query}}" />
<form method="get" action="/private/find" class="search-form">
<label for="lookup">Find People</label>
<input
type="search"
placeholder="[email protected]"
id="lookup"
name="handle"
aria-label="Search for people"
value="{{query}}" />
<button type="submit" class="search-button">Search</button>
</form>

</header>

{{#if results}}
{{#each results}}
<div class="activity">
{{> personCard actor=this nobio=true}}
</div>
{{/each}}
<div class="results-container">
{{#each results}}
<div class="search-result">
{{> personCard actor=this nobio=true}}
</div>
{{/each}}
</div>
{{else}}
<div class="activity">
Nobody results
<div class="no-results">
No results found.
</div>
{{/if}}
</div>
</section>
<script>
app.pollForPosts();
</script>
document.addEventListener('DOMContentLoaded', () => {
app.pollForPosts();
});
</script>
Loading