Skip to content

Commit

Permalink
Move tests next to implementation, and fix filename (#1393)
Browse files Browse the repository at this point in the history
## Summary:
The tests for axis ticks looked lonely hanging out in `__tests__`, so I
moved them next to the associated production code. I also renamed one
file from `tests.ts` to `test.ts` - the name was preventing Jest from
running the tests in that file.

Issue: none

## Test plan:

`yarn test`

Author: benchristel

Reviewers: mark-fitzgerald, SonicScrewdriver

Required Reviewers:

Approved By: mark-fitzgerald

Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald

Pull Request URL: #1393
  • Loading branch information
benchristel authored Jul 9, 2024
1 parent 8ae3d18 commit e6424d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-paws-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

Internal: Move and rename test files
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {showTickLabel} from "../graphs/components/axis-tick-labels";
import {showTickLabel} from "./graphs/components/axis-tick-labels";

it("should hide the first negative axis tick label if the gridStep > tickStep", () => {
const gridStep = 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {generateTickLocations} from "../axis-ticks";
import {generateTickLocations} from "./axis-ticks";

describe("generateTickLocations", () => {
it("should generate ticks from the origin", () => {
Expand Down

0 comments on commit e6424d5

Please sign in to comment.