Skip to content

Commit

Permalink
TC update for search path
Browse files Browse the repository at this point in the history
  • Loading branch information
sadanandpai committed Mar 28, 2024
1 parent 19ce83c commit e3b0254
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Binary file modified public/images/path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { pathFinders } from '@/apps/path-finder/algorithms';
import { Cell, CellType } from '@/apps/path-finder/models/interfaces';
import { highlightPath } from '@/apps/path-finder/store/path.thunk';

const updateCells = vi.fn(async (grid, cells, cellType = CellType.clear) => {
if (!Array.isArray(cells)) {
Expand Down Expand Up @@ -140,6 +141,7 @@ describe('BFS algorithm', () => {
exit,
updateCells,
});
highlightPath(grid, parents, 0);

expect(grid).toMatchSnapshot();
expect(parents).toMatchSnapshot();
Expand Down
3 changes: 2 additions & 1 deletion src/apps/path-finder/components/controller/execution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ function Execution({ defaultSpeed }: Props) {
dispatch(setGrid({ grid, clone: false }));
dispatch(setStatus(Status.Complete));
} catch {
// do nothing
// search cancelled
// no action needed
}
}

Expand Down

0 comments on commit e3b0254

Please sign in to comment.