Commit Graph

15 Commits

Author SHA1 Message Date
Landon Gilbert-Bland 56f9882e41 Make core translations and svg imports available in jest
Refs COMMS-1751

Test Plan:
  - Jenkins is happy

Change-Id: Ibe3e7ce2b22f7acd4ba7a80a84eb5a4fff5bf645
Reviewed-on: https://gerrit.instructure.com/173628
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
2018-11-29 16:09:47 +00:00
Steven Burnett 80b76607c6 fix timezone core import in jest
Test Plan:
- tests pass
- brent is happy

Change-Id: I26c021bd50e2cf63aec96aedd987f6b8c6370c62
Reviewed-on: https://gerrit.instructure.com/173592
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2018-11-28 21:27:42 +00:00
Jon Willesen 1898f2aa06 A2: teacher toolbox and code reorg
This is the first stab at implementing the teacher toolbox.

It also moves code toward the desired organization and frameworks.

closes ADMIN-1507

test plan:
- assignments 2 teacher view shows data on the right side of the header
  -> "X" is used as a placeholder value for values we don't have yet
- "X to grade" goes to the speedgrader for the assignment
- clicking on "Published" toggle shows a placeholder alert for the
  action
- clicking on "X unsubmitted" shows a placeholder alert for the action

Change-Id: I45f51789e2c3722f14482ab57d8d12244cff31b4
Reviewed-on: https://gerrit.instructure.com/170766
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2018-11-12 22:09:31 +00:00
Ryan Shaw d86d69015c Opt our js build tooling dirs into prettier
I guess since our team owns these we can opt them in now


Test plan:
* nothing should change

Change-Id: Ic7207e1033869ef60644c41bd5c80a3e8532a6dd
Reviewed-on: https://gerrit.instructure.com/171471
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-11-07 22:46:16 +00:00
Jon Willesen 3fddcf98e2 add enzyme snapshot serializer to jest
converts all the existing
`expect(component.debug()).toMatchSnapshot()`
to:
`expect(component).toMatchSnapshot()`
which creates more detailed and more diff-able snapshots

test plan:
- specs pass -- this only affects js test code

Change-Id: Ib6dbcc1e3f87e61a251e4635dc68353aca57aeac
Reviewed-on: https://gerrit.instructure.com/167651
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-10-09 21:16:59 +00:00
Ryan Shaw e1454a761c add jest-canvas-mock to silence a bunch of warnings
without this we get a bunch of warnings from our jest tests like:
Error: Not implemented: HTMLCanvasElement.prototype.getContext …

test plan:
you shouldn’t see those ^ messages in the jest logs

Change-Id: Ib257d4a6b40f4b4118f273729080e722afa3432a
Reviewed-on: https://gerrit.instructure.com/163515
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-07 15:18:15 +00:00
Clay Diffrient 2dc1d7fa86 Add a way to generate better js coverage
This should pick up coverage from both karma and jest
in Canvas proper.  It should also pick up coverage from anything under
packages/*

closes CORE-1265

Test Plan:
  - Run `COVERAGE=true yarn test`
     - Coverage reports (coverage-final.json) should generate in all
       packages such as (canvas-planner) as well as in coverage-karma
       and coverage-jest
  - Run `yarn run test:coverage`
     - coverage-js folder should be generated.  Opening index.html
       should show the full coverage report
  - Remove coverage-{js, karma, jest} and
    packages/canvas-planner/coverage as well as .nyc_output to get back
    to a clean state
  - Run `RUN_TESTS_FIRST=true yarn run test:coverage`
     - All tests should run and generate the appropriate report just
       like the last time in coverage-js

Change-Id: I50744b8977e0683e079af5bdd2865dbcd6ad9066
Reviewed-on: https://gerrit.instructure.com/146098
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-07-17 14:19:03 +00:00
Frank Murphy 3b937041fc Fix jest deprecation warning.
Test Plan:
- With freshly installed npm modules,
- Verify "testResultsProcessor support is deprecated" is no longer
  displayed when running jest tests locally.
- Open the jenkins job from this PS.
- Go to the test report > (root)
- Verify "Free-form Rubric with a custom criterion by default renders
  the root component as expected" is present in the report

Change-Id: I921138e2a9a1025a3ed665693a6223819bf76392
Reviewed-on: https://gerrit.instructure.com/156778
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Neil Gupta <ngupta@instructure.com>
QA-Review: Neil Gupta <ngupta@instructure.com>
2018-07-10 22:06:00 +00:00
Jeremy Neander d370ed21b7 spec: restrict jest filename matching
By default, jest uses the following matchers:

  '**/__tests__/**/*.js?(x)'
  '**/?(*.)(spec|test).js?(x)'

It looks for .js and .jsx files inside of __tests__ folders, as well as
any files with a suffix of .test or .spec (e.g. Component.test.js or
Component.spec.js). It will also find files called test.js or spec.js.

This means that ANY file in the __tests__ folders is considered to be a
test file and will fail if it does not contain any specs. The prohibits
the use of supporting helper files and/or other such code to aid in
testing.

The change in this commit restricts the matcher to only files contained
within __tests__ paths with names ending in spec.js or test.js
(e.g., thing.test.js, spec.js)

Change-Id: Ied771b9e8dd5ad8fd24a9de70f1edb9a272ed3c1
Reviewed-on: https://gerrit.instructure.com/142657
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Jeremy Neander <jneander@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
2018-03-06 20:24:50 +00:00
Clay Diffrient 928f334cfb Convert theme editor sidebar to use instui
closes CORE-1017

Test Plan:
  - Enable Theme Editor Refactor feature flag
  - The sidebar tabs (Edit/Upload) should use InstUI
  - On the Edit tab, the accordions should use InstUI
  - When the feature flag is off the jQuery UI stuff
    should be used.

Change-Id: Ic8bfac91d644fc75618f1f0898afbcfcf411c3fd
Reviewed-on: https://gerrit.instructure.com/140561
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-02-22 20:31:59 +00:00
Ryan Shaw 8d2d33489e Restore ThemeEditor to how it was before InstUI conversion
Fixes: CORE-856

This is to fix the bug that was found on beta, once we figure out a way
around that we can revert this revert and move forward

this is the result of `git revert 2fce80fe6d 96bfe1f8c2 72ca2dcacb

Test Plan:
  - Go to the theme editor for a theme
  - Make changes to the theme (including stuff inside each of the
    different hidden areas) on the Edit tab
  - Preview changes, after change those fields should reflect the
    new changes
  - Enable global css/js on the account
  - Do the same test as done previously, modifying fields, etc.
  - Switch to the Upload tab and preview changes, changes should
    still apply
  - Upload CSS/JS and preview, changes should apply
  - Upload different CSS/JS, switch to the Edit tab
  - Preview and notice that changes still apply

Revert "Convert Theme Editor Accordion to use Inst UI"
This reverts commit 2fce80fe6d.

Revert "Convert ThemeEditorAccordion to ES class"
This reverts commit 96bfe1f8c2.

Revert "Convert theme editor sidebar to use InstUI"
This reverts commit 72ca2dcacb.

Change-Id: I0ac36b144c325eaa5ae7d8c4ba86b7807aa3431b
Reviewed-on: https://gerrit.instructure.com/139594
Reviewed-by: Tucker McKnight <tmcknight@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Gentry Beckmann <gbeckmann@instructure.com>
2018-01-31 01:25:26 +00:00
Ryan Shaw d8259be7cc speed up JS tests by running them concurrently
closes: CORE-865

In order to get accurate coverage reports (ie: so the coverage numbers 
don’t only reflect a fraction of the total tests), when the COVERAGE 
environment variable is set, it does not split them out into groups to
run concurrently. That way our linters-and-js-master build (which sets
that environment variable) will run the same as it always has and our 
patch-set builds (which run the linters-and-js) will be faster.

Test plan:
* run ‘yarn test’
* it should be a lot faster than it used to be

* look at the linters-and-js build in jenkins for this commit
* it should have test reports for all both groups (coffee, js)
  Of karma tests as well as for the jest tests.

* look at the coverage report after this gets merged. It should be
  the same as it was before

Change-Id: I35147cc84df4afae92c1a73c201667d4d44b5518
Reviewed-on: https://gerrit.instructure.com/136373
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-01-16 19:32:28 +00:00
Ryan Shaw a33231cf0a let jest know about some of our aliases
…and prevent a giant error from being logged from ui-themable


test plan:
* the “Add Ability To Add External RSS Feeds…” commit that is based
  on top of this should pass jest
* you should not see an errors like this when jest runs:
console.error node_modules/@instructure/ui-themeable/lib/registry.js:342
      TypeError: Cannot read property 'porcelain' of undefined


Change-Id: I8a9583a3d16394a919a223cedfd577aef7f70ec1
Reviewed-on: https://gerrit.instructure.com/137778
Product-Review: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
2018-01-12 19:16:18 +00:00
Clay Diffrient 2fce80fe6d Convert Theme Editor Accordion to use Inst UI
closes CORE-691

Test Plan:
  - Edit tab works as expected
  - You can move between "accordion" pieces in an
    accessible manner
  - Testing this also proves g/135762 is good as well
Change-Id: Iee447bc97ad5392e74b033b072179f20984e3f6e
Reviewed-on: https://gerrit.instructure.com/135893
Tested-by: Jenkins
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2018-01-08 21:39:24 +00:00
Ryan Shaw f2240b0985 move jest config to it’s own file
Change-Id: I0071e39fdde33a7c14e7360e31751e5329be5fff
Reviewed-on: https://gerrit.instructure.com/136372
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-12-28 21:02:03 +00:00