Skip to content

Commit

Permalink
Major Refactor: Query + Completion Logic + Testing Infrastructure (#31)
Browse files Browse the repository at this point in the history
* Checkpoint

* Refactor limit logic

* WIP: Bug Fix: Limit logic should skip round if needed to get target due/new in other deck

* Fix go to next deck from done screen

when on done screen currentCardData is undefined.

* WIP: Show completed count on finish screen

* WIP: Saving current state before pivot

* Ignore lottie type error

* Finalize refactor to calculate completed count without storing state and persisting distribution accross re-runs

* Fix missing card bug while grading

* WIP: Fix overlay counts

* Update display counters to reflect completed today

* Fix useCurrentCardData tests

* WIP: Fix card resolution logic

* fix timezone test issue

* Fix practice click delay by advancing index right away

We reset after we fetch the new list

* fix types

* supress componentWillUpdate warning

Here we don't control the react version

* Add first overlay test finished state

* Fix issues + add more tests

* fix lint errors

* fix skipping bug

done state needed to account for doing so without grading (which
recalculates today state)

* Bug Fix: missing new cards

* Fix cramming missing cards

* on close, reset cramming state

* fix cramming mode bugs
  • Loading branch information
digitalmaster committed Oct 13, 2024
1 parent b9ce0c3 commit 77da721
Show file tree
Hide file tree
Showing 28 changed files with 4,023 additions and 1,457 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

14 changes: 14 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const isTest = String(process.env.NODE_ENV) === 'test'

module.exports = {
presets: [
[
"@babel/preset-react",
{
...(isTest && { runtime: "automatic" })
}
],
"@babel/preset-env",
"@babel/preset-typescript"
],
}
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
tailwind.config.js
webpack.config.js
changelog-setup.js
jest.setup.js
jest.setup.ts
3 changes: 0 additions & 3 deletions jest.setup.js

This file was deleted.

26 changes: 26 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import '@testing-library/jest-dom';

const originalConsoleError = console.error;
const originalConsoleWarn = console.warn;

beforeAll(() => {
// Since we don't have control over the version of react installed on roam
// let's just supress these warnings
console.error = (...args) => {
if (/Invalid prop/.test(args.toString())) {
return;
}
originalConsoleError(...args);
};
console.warn = (...args) => {
if (/componentWillUpdate has been renamed/.test(args.toString())) {
return;
}
originalConsoleWarn(...args);
};
});

afterAll(() => {
console.error = originalConsoleError;
console.warn = originalConsoleWarn;
});
Loading

0 comments on commit 77da721

Please sign in to comment.