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

Consolidate Interactive Graph tests and stories #1592

Merged
merged 5 commits into from
Sep 5, 2024

Conversation

benchristel
Copy link
Member

This commit just moves files around. Specifically, it moves the
tests, test data, and stories for the Interactive Graph widget into
the widgets/interactive-graphs directory.

Issue: none

Test plan:

yarn test

@benchristel benchristel self-assigned this Sep 4, 2024
@khan-actions-bot khan-actions-bot requested a review from a team September 4, 2024 21:14
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Sep 4, 2024

Gerald

Required Reviewers
  • @Khan/perseus for changes to .changeset/neat-ghosts-sing.md, dev/gallery.tsx, packages/tsconfig-shared.json, packages/perseus/src/__tests__/renderer-api.test.tsx, packages/perseus/src/__tests__/renderer.test.tsx, packages/perseus-editor/src/__stories__/interactive-graph-editor.stories.tsx, packages/perseus/src/components/__tests__/sorter.test.tsx, packages/perseus/src/widgets/__testdata__/randomizers.test.ts, packages/perseus/src/widgets/__testutils__/renderQuestion.tsx, packages/perseus/src/widgets/categorizer/categorizer.test.ts, packages/perseus/src/widgets/cs-program/cs-program.test.ts, packages/perseus/src/widgets/definition/definition.test.ts, packages/perseus/src/widgets/dropdown/dropdown.test.ts, packages/perseus/src/widgets/explanation/explanation.test.ts, packages/perseus/src/widgets/expression/expression.test.tsx, packages/perseus/src/widgets/graded-group/graded-group.test.ts, packages/perseus/src/widgets/graded-group-set/graded-group-set-jipt.test.ts, packages/perseus/src/widgets/graded-group-set/graded-group-set.test.ts, packages/perseus/src/widgets/grapher/grapher.test.ts, packages/perseus/src/widgets/group/group.test.tsx, packages/perseus/src/widgets/iframe/iframe.test.ts, packages/perseus/src/widgets/image/image.test.ts, packages/perseus/src/widgets/input-number/input-number.test.ts, packages/perseus/src/widgets/interaction/interaction.test.ts, packages/perseus/src/widgets/interactive-graphs/interactive-graph-regression.stories.tsx, packages/perseus/src/widgets/interactive-graphs/interactive-graph.stories.tsx, packages/perseus/src/widgets/interactive-graphs/interactive-graph.test.tsx, packages/perseus/src/widgets/interactive-graphs/interactive-graph.testdata.ts, packages/perseus/src/widgets/matcher/matcher.test.tsx, packages/perseus/src/widgets/matrix/matrix.test.ts, packages/perseus/src/widgets/number-line/number-line.test.ts, packages/perseus/src/widgets/numeric-input/numeric-input.test.ts, packages/perseus/src/widgets/orderer/orderer.test.ts, packages/perseus/src/widgets/passage-ref/passage-ref.test.ts, packages/perseus/src/widgets/phet-simulation/phet-simulation.test.ts, packages/perseus/src/widgets/python-program/python-program.test.ts, packages/perseus/src/widgets/video/video.test.ts, packages/perseus/src/widgets/deprecated-standin/__tests__/deprecated-standin.test.ts, packages/perseus/src/widgets/interactive-graphs/__snapshots__/interactive-graph.test.tsx.snap, packages/perseus/src/widgets/interactive-graphs/locked-figures/locked-functions.stories.tsx, packages/perseus/src/widgets/label-image/__tests__/label-image.test.ts, packages/perseus/src/widgets/passage/__tests__/passage.test.tsx, packages/perseus/src/widgets/radio/__tests__/radio.test.ts

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Copy link
Contributor

github-actions bot commented Sep 4, 2024

Size Change: 0 B

Total Size: 858 kB

ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38.3 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 4.27 kB
packages/math-input/dist/es/index.js 78 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 1.48 kB
packages/perseus-editor/dist/es/index.js 275 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus/dist/es/index.js 417 kB
packages/perseus/dist/es/strings.js 3.36 kB
packages/pure-markdown/dist/es/index.js 3.66 kB
packages/simple-markdown/dist/es/index.js 12.4 kB

compressed-size-action

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.68%. Comparing base (9dad8a0) to head (e64fa42).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1592      +/-   ##
==========================================
+ Coverage   70.51%   70.68%   +0.17%     
==========================================
  Files         546      572      +26     
  Lines      106814   111436    +4622     
  Branches     5528    11880    +6352     
==========================================
+ Hits        75316    78773    +3457     
- Misses      31382    32663    +1281     
+ Partials      116        0     -116     

Impacted file tree graph

see 1118 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9dad8a0...e64fa42. Read the comment docs.

Copy link
Contributor

@handeyeco handeyeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! Just some IDE weirdness related to auto-changing import paths, but after that it looks good.

@@ -1,8 +1,8 @@
import * as React from "react";

import Renderer from "../../renderer";
import {mockStrings} from "../../strings";
import {interactiveGraphQuestionBuilder} from "../interactive-graphs/interactive-graph-question-builder";
import {mockStrings} from "@khanacademy/perseus/strings";
Copy link
Contributor

@handeyeco handeyeco Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed my IDE did this too; will need to switch back to relative imports (I think it has to do with the fact that Perseus has a new perseus/strings export.)

// from packages/perseus/package.json
    "exports": {
        ".": {
            "import": "./dist/es/index.js",
            "require": "./dist/index.js",
            "types": "./dist/index.d.ts",
            "source": "./src/index.ts"
        },
        "./strings": {
            "import": "./dist/es/strings.js",
            "require": "./dist/strings.js",
            "types": "./dist/strings.d.ts",
            "source": "./src/strings.ts"
        },
        "./styles.css": "./dist/index.css"
    },

@benchristel benchristel force-pushed the benc/consolidate-interactive-graph-code branch from cdcac91 to 46f0bbd Compare September 5, 2024 18:05
Copy link
Contributor

github-actions bot commented Sep 5, 2024

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (e64fa42) and published it to npm. You
can install it using the tag PR1592.

Example:

yarn add @khanacademy/perseus@PR1592

If you are working in Khan Academy's webapp, you can run:

./dev/tools/bump_perseus_version.sh -t PR1592

@benchristel benchristel merged commit d88b0ff into main Sep 5, 2024
12 of 13 checks passed
@benchristel benchristel deleted the benc/consolidate-interactive-graph-code branch September 5, 2024 18:23
mark-fitzgerald pushed a commit that referenced this pull request Sep 10, 2024
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.


# Releases
## @khanacademy/[email protected]

### Major Changes

-   [#1591](#1591) [`05d048026`](05d0480) Thanks [@handeyeco](https://github.com/handeyeco)! - Move interaction-editor sub-components into perseus-editor

### Minor Changes

-   [#1568](#1568) [`eddcb9417`](eddcb94) Thanks [@nishasy](https://github.com/nishasy)! - [Interactive Graph + Editor] Add a full graph aria-label and aria-description/describedby to interactive graphs, as well as the UI for content authors to add this in the interactive graph editor

### Patch Changes

-   [#1540](#1540) [`08068dc71`](08068dc) Thanks [@mark-fitzgerald](https://github.com/mark-fitzgerald)! - Resolve improperly scaled text/labels in Graphie images when viewed in mobile (constrained viewports)


-   [#1592](#1592) [`d88b0ffdf`](d88b0ff) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Move tests, test data, and Storybook stories for the Interactive Graph widget to the directory specific to that widget.


-   [#1594](#1594) [`435f3f6d8`](435f3f6) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Remove Storybook stories that generate random widgets


-   [#1599](#1599) [`71715afd2`](71715af) Thanks [@benchristel](https://github.com/benchristel)! - Internal: improve type safety of interactive graph editor


-   [#1590](#1590) [`6c4e9e154`](6c4e9e1) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Move InteractiveGraphEditor to its own directory

## @khanacademy/[email protected]

### Minor Changes

-   [#1600](#1600) [`bdb382fda`](bdb382f) Thanks [@mark-fitzgerald](https://github.com/mark-fitzgerald)! - Interactive Graph - Add example functions for copy/paste to locked functions settings


-   [#1568](#1568) [`eddcb9417`](eddcb94) Thanks [@nishasy](https://github.com/nishasy)! - [Interactive Graph + Editor] Add a full graph aria-label and aria-description/describedby to interactive graphs, as well as the UI for content authors to add this in the interactive graph editor

### Patch Changes

-   [#1592](#1592) [`d88b0ffdf`](d88b0ff) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Move tests, test data, and Storybook stories for the Interactive Graph widget to the directory specific to that widget.


-   [#1591](#1591) [`05d048026`](05d0480) Thanks [@handeyeco](https://github.com/handeyeco)! - Move interaction-editor sub-components into perseus-editor


-   [#1594](#1594) [`435f3f6d8`](435f3f6) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Remove Storybook stories that generate random widgets


-   [#1599](#1599) [`71715afd2`](71715af) Thanks [@benchristel](https://github.com/benchristel)! - Internal: improve type safety of interactive graph editor


-   [#1590](#1590) [`6c4e9e154`](6c4e9e1) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Move InteractiveGraphEditor to its own directory

-   Updated dependencies \[[`08068dc71`](08068dc), [`d88b0ffdf`](d88b0ff), [`eddcb9417`](eddcb94), [`05d048026`](05d0480), [`435f3f6d8`](435f3f6), [`71715afd2`](71715af), [`6c4e9e154`](6c4e9e1)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   [#1592](#1592) [`d88b0ffdf`](d88b0ff) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Move tests, test data, and Storybook stories for the Interactive Graph widget to the directory specific to that widget.


-   [#1594](#1594) [`435f3f6d8`](435f3f6) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Remove Storybook stories that generate random widgets

Author: khan-actions-bot

Reviewers: mark-fitzgerald

Required Reviewers:

Approved By: mark-fitzgerald

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

Pull Request URL: #1597
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants