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

test code #1

Merged
merged 5 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Tests
on: push
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -15,6 +18,9 @@ jobs:
restore-keys: v1/${{ runner.os }}/node-14/
- name: Install dependencies
run: npm install
- name: Percy Variables
run: |
export PERCY_TOKEN=${{ secrets.PERCY_TOKEN }}
- name: Run tests
run: npm test
env:
Expand Down
20 changes: 7 additions & 13 deletions js/TodoFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ function pluralize(count, word) {
return count === 1 ? word : word + 's';
}

export default function TodoFooter({
activeCount,
completedCount,
showTodos,
onClearCompleted,
onShowTodos
}) {
export default function TodoFooter({ activeCount, completedCount, showTodos, onClearCompleted, onShowTodos }) {
return (
<footer className="footer">
<span className="todo-count">
Expand All @@ -20,22 +14,22 @@ export default function TodoFooter({
</span>

<ul className="filters">
{['all', 'active', 'completed'].map(filter => (
{['all', 'active', 'completed'].map((filter) => (
<li key={filter}>
<a
style={{ cursor: 'pointer' }}
onClick={() => (onShowTodos(filter), false)}
className={classNames({ selected: showTodos === filter })}>
{filter[0].toUpperCase()}{filter.substring(1)}
className={classNames({ selected: showTodos === filter })}
>
{filter[0].toUpperCase()}
{filter.substring(1)}
</a>
</li>
))}
</ul>

{completedCount > 0 ? (
<button
className="clear-completed"
onClick={onClearCompleted}>
<button style={{ backgroundColor: 'red' }} className="clear-completed" onClick={onClearCompleted}>
Clear completed
</button>
) : null}
Expand Down
Loading