Commit Graph

33 Commits

Author SHA1 Message Date
Charley Kline 0c21111e77 Make type filter searchable on courses main list
Closes USERS-515
flag=none

This makes the "Filter by term" select box on the main courses
page searchable by typing into the box to narrow down the
choices. Similar functionality is already present in the
corresponding selections in the New Course modal.

Because this selection dropdown includes groups, it necessitated
a complete rewrite of the SearchableSelect component so that it
works a little more like CanvasSelect in handling its children.
It no longer depends on CanvasAsyncSelect.

SearchableSelect was almost completely rewritten from scratch so
I would recommend just reviewing the new module an ignoring the
diff from the old one. Hopefully it is more generally useful now
like CanvasSelect is.

In the course of writing tests for this, I discovered that all
our supported browsers implement Array.prototype.flat(), so it
is safe to use. What does NOT implement it, however is Jest 🤦
so I also implemented them as polyfills in the jest-setup.js
and now everyone can use them in the future.

Test plan:
* Have a bunch of terms
* Go to /accounts/default
* Click on "Filter by term" to bring up the selection dropdown
* It should work just like it used to to filter the courses list
* Now try typing in the box... it should filter the available
  selections in the dropdown while you type
* If no terms match what you're typing, the dropdown should go
  away altogether and the select box itself should get a red
  highlight with red error text
* A11y should be okay

Change-Id: I3da8dd681645f83f858996fe42030ad400eada01
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/237585
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Matt Meservey
QA-Review: August Thornton <august@instructure.com>
2020-05-19 01:24:11 +00:00
jonw d48344a5e1 add overrides and editing to bulk assignment edit
closes LA-847
flag=assignment_bulk_edit

test plan:
- Assignments and their overrides should be displayed with their dates
- Each date input should function and work independently

Change-Id: Ia2206bcae8b462535e3bcc99bf024bfaae39bc3e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230953
QA-Review: Anju Reddy <areddy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
2020-04-06 21:36:14 +00:00
Ryan Shaw 2ef60dfc22 spec: fix handlebars transform for jest tests
This was broken because jest would die on the
`import _Handlebars from 'handlebars/runtime’`
In frontend_build/i18nLinerHandlebars.js

Test plan:
* you should be able to import a file that imports a handlebars file
  In jest tests

Change-Id: I021de6650dd97270e10709495a42b84b6b4a4505
Reviewed-on: https://gerrit.instructure.com/208112
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-09-05 15:03:54 +00:00
Ryan Shaw e782fb7012 filter non-actionable console logs everywhere else too
I did this first for canvas’s jest tests, but this does it for
karma/qUnit, canvas-rce, canvas-planner and dev mode too.

test plan:
* run `yarn test`
* you should see a lot less react deprecation messages

Change-Id: I5f5cee08d705b749526be87fd79cfc937c015145
Reviewed-on: https://gerrit.instructure.com/206879
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-27 19:54:09 +00:00
Ryan Shaw cfb60be2da Filter out unactionable console messages
Also, fix some


Test plan:
* run `yarn jest`
* you should see less of those react 16.9.x lifestyle deprecations
  In the console output

Change-Id: Ic63e977fe8067756d0a276e316b23dab004da94f
Reviewed-on: https://gerrit.instructure.com/206813
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-26 22:17:54 +00:00
Clay Diffrient 6554a019d8 Remove autobreadcrumbs from xhr requests in Raven
This will prevent Raven from mocking out the global fetch function.
Tests that rely on the mocking functionality will pass.  This also
removes a console.log statement that led to this discovery

Test Plan:
  - Provide a valid DEPRECATION_SENTRY_DSN environment variable
  - Run Navigation.test.js and it should pass

closes CORE-214

flag = none

Change-Id: I7e229c39808ca0bffed7caf2e2ed25755c7f6185
Reviewed-on: https://gerrit.instructure.com/205914
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2019-08-20 23:34:20 +00:00
Clay Diffrient d2c7180e12 spec: Mock fetch on global
refs COREFE-214

Test Plan:
  - Specs pass

flag = none

Change-Id: I6c7cbcb6fdc6771e56ff78b37a532948c19610c6
Reviewed-on: https://gerrit.instructure.com/205825
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-20 19:28:48 +00:00
Clay Diffrient a6def4ef80 Remove other places where sentry was being noisy
Test Plan:
  - Errors don't show in Slack

closes CORE-2894

flag = none

Change-Id: Ib4fe995fc54372ffed635751cde08ce4d1a92772
Reviewed-on: https://gerrit.instructure.com/204502
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-09 15:31:14 +00:00
Ryan Shaw 772d1f6994 don’t count unread_count or dashcard indicators against newRelic load time
closes: CORE-3187

AKA:
Revert "Revert "don’t count unread_count or dashcard indicators 
against newRelic load time""

This reverts commit d754ff5ed1.

Test plan:
* the little badges that show unread discussion counts and stuff
  on each dashcard should work the same as before
* the badge on the global nav that shows how many unread inbox messages
  You have should work the same as before
  * if you have newRelic set up, neither should count against page load
  metrics

Change-Id: I3b869e7fb650f40f16f514db9d8b9f558443db5b
Reviewed-on: https://gerrit.instructure.com/201202
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-07-16 20:38:06 +00:00
gbeckmann d754ff5ed1 Revert "don’t count unread_count or dashcard indicators against newRelic load time"
This reverts commit aa977ecd2a.

Reverting based on belief that this is surfacing errors in the build:

"something went wrong updating unread count" TypeError: Failed to fetch

Change-Id: I842ad732d75c6ca83f31e140ddf5edb6f10e45fe
Reviewed-on: https://gerrit.instructure.com/201108
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2019-07-13 01:06:56 +00:00
Ryan Shaw aa977ecd2a don’t count unread_count or dashcard indicators against newRelic load time
closes: CORE-3084

Test plan:
* the little badges that show unread discussion counts and stuff
  on each dashcard should work the same as before
* the badge on the global nav that shows how many unread inbox messages
  You have should work the same as before
* if you have newRelic set up, neither should count against page load
  metrics

Change-Id: I03f81c30223355ce3e1a2632ba17bfd6f1ae658f
Reviewed-on: https://gerrit.instructure.com/197823
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-07-11 22:09:37 +00:00
Clay Diffrient e6f61f70bb Fix failing setupRavenConsoleLoggingPlugin on the master build
Change-Id: I0766d301653a6cf992cad5407c6e6d932aef65fc
Reviewed-on: https://gerrit.instructure.com/195853
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2019-05-30 20:56:41 +00:00
Ryan Shaw 3bad0a160b Remove add-module-exports babel plugin & use esModules
Closes: CORE-2868 CORE-2869

This is needed because without
Doing that, our bundle sizes are going to blow up from the things we
Import from InstUI

Test plan:
* the result of a dynamic export will now give you a object grab bag
  That has a “default” property. Not just the thing of whatever the
  “default" export was.
* so to test this, go to some page that does a dynamic import (like
  the dashboard page) and make sure that still works\

* run a prod build
* make sure that translations still work as before

Change-Id: I3dd1b32216052afd5fbc5d6cec40ea18264f65e9
Reviewed-on: https://gerrit.instructure.com/191578
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-05-03 22:49:58 +00:00
Ryan Shaw ed46527652 Upgrade to babel 7 & allow any js file to be themeable
closes: CORE-2699 CORE-2700 UIDEV-99

This commit gets canvas-lms itself upgraded to babel 7. To do that we
also had to upgrade jest to v24. We had already got canvas-rce and
canvas-planner on jest24/babel7 but now this gets everything to babel 7.
so you will see a lot of things removed from yarn.lock since we don’t
don’t have to have different versions of everything for babel and jest

The other major thing this does is make it so any JS file in canvas
can become an @instructure/ui-themeable themeable component. This means
you no longer should have to put your css in app/stylesheets for any new
react components that you are writing.

Test plan:
1. Make sure that the perf of `yarn build:js` is on-par with what it was
   before. We pass everything through the themeable babel transform now
   so there is a chance it is slower. If it is majorly slower, we’ll have
   to figure something out.
2. run a production weback build. The common (or any bundle for that
   matter should get output exactly the same as it did before)

things to manually qa check:
* in a NODE_ENV=production enviornment, go to
  /accounts/site_admin/developer_keys
* click the "+ Developer Key" button, it should open the modal.
  (there are selenium tests that do this, but it was one thing that had
  to be fixed to get jenkins to pass)

* on a course that is set up as a master course, click on the thing that
  opens the blueprint courses tray.
* verify that when you click "Associations" and "Sync History" links in
  that tray, that they dynamically load the webpack chunk for the
  modal contents for that thing and then the modal is shown
  (again, there are selenium specs that test that exact thing but it
  is always good to manually test it too)

Change-Id: I802584228962b54480a500f8fe422f45c2dcac4c
Reviewed-on: https://gerrit.instructure.com/183965
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-04-02 14:59:20 +00:00
Brent Burgoyne 70bc10e80c un-mock RichContentEditor in jest tests
coffeescript and amd files are supported now, so this is not needed.

test plan:
- all existing jest tests pass

Change-Id: If1d0a110451d6c87dca0aaf5fccdf011c3fd02ca
Reviewed-on: https://gerrit.instructure.com/186472
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
Tested-by: Jenkins
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-03-22 17:29:58 +00:00
Brent Burgoyne a7b07e869e make jest support files that import handlebars
Change-Id: I073ea3f8b54cf46cd2b4c2437aad5ee13c95dc7c
Reviewed-on: https://gerrit.instructure.com/186286
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-03-22 15:38:23 +00:00
Steven Burnett 637d2f6241 clean up jest-setup
Test Plan:
- tests pass

Change-Id: I2a536b3094f78270365a75122e0be1fb742bbd34
Reviewed-on: https://gerrit.instructure.com/186330
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-03-21 19:36:57 +00:00
Steven Burnett 0716aed60d silence instui focusable errors
Test Plan:
- tests pass and errors are still shown in console
  that aren't of the type "0 focusable"

Change-Id: I451a363e70bd36c83eaa76ac0fec7aaeec0c5952
Reviewed-on: https://gerrit.instructure.com/186282
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
2019-03-21 17:12:45 +00:00
Jon Willesen 559dc2953f A2: create message students who modal basics
refs ADMIN-1512

This is just the basic "show the modal" work. The modal doesn't actually
accomplish anything yet. That work will be done in a separate commit, as
this one was getting large.

test plan:
- unsubmitted button should open a message students who modal that more
  or less looks like the mockup.
- when there is no submission or a paper submission, the unsubmitted
  button is replaced with a "message students" button.
- the list of students in the course is shown. It may not be completely
  accurate yet. For example, we're not filtering out the test student.
- The dropdown doesn't work yet.
- you can delete students from the list, and add students back into the
  list.
- you can close and cancel the dialog.
- when you click save, the modal pretends to work for a few seconds, and
  then there is an alert indicating nothing really happened.

Change-Id: I815139c1d6c5b6108fda34c319de2686bb8c6ebd
Reviewed-on: https://gerrit.instructure.com/179827
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-02-28 16:12:39 +00:00
Brent Burgoyne 96315b8626 support testing coffeescript with jest
Change-Id: I540ad44c033e489ff49c251256263d547ca258cd
Reviewed-on: https://gerrit.instructure.com/182600
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-02-25 17:57:15 +00:00
Jon Willesen eb570068d3 A2: convert teacher view to use apollo components
closes ADMIN-2416

test plan:
- automated tests pass
- assignment data still loads
- assignment can still be published/unpublished
  - new feature: toggle is disabled while the operation is in progress
- assignment can still be deleted

Change-Id: I03d877bfaa1693d665590ea615dcaa8b51b77e61
Reviewed-on: https://gerrit.instructure.com/181027
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-02-20 16:13:56 +00:00
Jon Willesen d82b5fafe6 A2: implement delete button
closes ADMIN-2233

test plan:
- click the delete button which will open a confirmation dialog that
  roughly matches the design
- a11y for the dialog should make sense
- the close button should dismiss the dialog with no effect
- the cancel button should dismiss the dialog with no effect
- the delete button should start a delete operation
- when the delete operation completes, you should be redirected to the
  assignment index screen with a message indicating the assignment has
  been deleted
- if your user does not have permission to delete the assignment, or
  some other error occurs, then the in-development error screen should
  be shown

Change-Id: I0c3304360d3c389296bd0910d02d8215bdb0ac9e
Reviewed-on: https://gerrit.instructure.com/177754
Reviewed-by: Carl Kibler <ckibler@instructure.com>
Tested-by: Jenkins
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-01-30 22:23:46 +00:00
Jeremy Neander 7144c8dce1 spec: add fetch polyfill for jsdom
Because JSDOM has … needs.

Change-Id: I3b929d96dc208c6b32802bbfa806cc22adff7fdf
Reviewed-on: https://gerrit.instructure.com/177129
Tested-by: Jenkins
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Keith Garner <kgarner@instructure.com>
2019-01-08 17:16:31 +00:00
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
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 d4334bec3b [spec] ensure MutationObserver exists to fix flaky jest test
see: 
http://jenkins.instructure.com/job/canvas__linters-and-js/50286/testReport/junit/(root)/KeyboardShortcutModal%20appears%20when%20shift%20+%20_%20is%20pressed/KeyboardShortcutModal_appears_when_shift_____is_pressed/
for a bad example

Change-Id: I09e303fdad1d9d63f1bbf61ea01be9dff165d1d8
Reviewed-on: https://gerrit.instructure.com/166029
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-27 16:16:03 +00:00
Ryan Shaw 351ebd6652 upgrade react from 15.x to 16.x
closes: CORE-1874

test plan:
Now that the automated selenium & javascript specs pass for this the
last thing we need to do is to go manually click around and see if
anything breaks.

The best thing to do would be to open your browser console and look
for errors. Deprecation warnings or propType errors  or react warnings
are fine but if any actual errors get thrown that is something we want
to look into.

specific things to look at:
* all the gradezilla/gradebook/grading stuff (specifically things that
  have instUI <NumberInput>s and <Select>s)
  * look at the submission cell editor
  * the gb headers (especially make sure keyboard navigation works how
  it should)
  * moderated grading
  * grading perid edit page / enrollment terms
  * speedgrader
  * grading standards
  * gradebook history
* theme editor
* new discussions/announcements
* the new permissions page
* the dasboard
  * student planner
  * dashcards
* global nav trays
  * help menu
* assignment edit page
* account user/course search

Change-Id: I6a1fe7df9379d9c601eda932bd8cef9c06d10cd2
Reviewed-on: https://gerrit.instructure.com/163913
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-09-26 19:04:47 +00:00
Ryan Shaw 32667d33e2 upgrade react from 0.14.9 to 15.x
closes: CORE-1857 CORE-294
also closes: CORE-1856 CORE-294 CORE-1841 CORE-71 CORE-302 CORE-301
also closes: CORE-300 CORE-299 CNVS-34315 CORE-298 CORE-243 CORE-297
also closes: CORE-296 CORE-295

test plan:
now that the automated selenium & javascript specs pass for this the
last thing we need to do is to go manually click around and see if
anything breaks.

the best thing to do would be to open your browser console and look
for errors. deprecation warnings or propType errors  or react warnings
are fine but if any actual errors get thrown that is something we want
to look into.

specific things to look at:
* account user/course search
* all the gradezilla/gradebook/grading stuff (specifically things that
  have instUI <NumberInput>s)
  * look at the submission cell editor
  * the gb headers
  * moderated grading
* the stuff for adding external apps
* theme editor
* new discussions/announcements
* the new permissions page
* the dasboard
  * student planner
  * dashcards
* global nav trays
  * help menu

Change-Id: I0d71ffda08e306927616d3e976b09cd1775fba10
Reviewed-on: https://gerrit.instructure.com/163518
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-17 15:42:14 +00:00
Clay Diffrient 5abf86627b Enhance sentry deprecation reporting
refs CORE-1460

This expands reporting away from just selenium specs to JS specs as
well, both Jest and QUnit.

It also moves the console plugin bit out to a separate module for
better reusability.

Test Plan:
  - Specs pass, sentry picks stuff up.

Change-Id: Ie6dcf24de4ddeb3797244e1d9a48f0d56ff5574c
Reviewed-on: https://gerrit.instructure.com/162009
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-08-24 17:20:41 +00:00
Ryan Shaw 354bf2df06 upgrade enzyme to 3.x
Closes: CORE-1758

After this commit, if you or your team have any specs that import
from old-enzyme-2.x-you-need-to-upgrade-this-spec-to-enzyme-3.x-by-importing-just-enzyme
That means you need to upgrade those spec files to use the new enzyme
by changing that to `import {mount, shallow, whatever} from ‘enzyme’`.
Refer to http://airbnb.io/enzyme/docs/guides/migration-from-2-to-3.html
for details

Test plan:
* all linters-and-js-specs should pass
* since this only effects js specs, that is all that really matters. 
  no app code to QA

Change-Id: I46c5d815e9d95683832d70b64e31526b943d07e5
Reviewed-on: https://gerrit.instructure.com/135136
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-08-23 14:44:23 +00:00
Ryan Shaw b991b7ed38 jest: mute instUI warning about needing dir attr
Test plan:
* run `yarn run jest`
* you should not see any of these warnings:
Warning: [themeable] component styles require setting a 'dir' attribute
on the HTML element. To prevent breaking changes, we'll set it to a 
default value: 'ltr'.

Change-Id: I5e63f069772dc305ba91d4033e0922f2b6fdefc5
Reviewed-on: https://gerrit.instructure.com/153561
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-06-13 16:14:37 +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
Ryan Shaw 88c1c61bdf Add Jest for testing JavaScript
closes: CNVS-34337

* For now, you can only test things that don’t require any coffeescript
  files
* Write your tests using es6 module syntax
* see app/jsx/shared/helpers/__tests__/parseLinkHeader.test.js for an
  example

test plan:
* run `yarn run jest`
* you should see some output like:
 PASS  app/jsx/shared/helpers/__tests__/parseLinkHeader.test.js
 PASS  app/jsx/actAs/__tests__/ActAsModal.test.js

Test Suites: 2 passed, 2 total
Tests:       5 passed, 5 total
Snapshots:   1 passed, 1 total
Time:        3.072s
Ran all test suites.
* make sure it runs on jenkins build

Change-Id: Ia79cd8ce35dc863c4cc5ce7512998320c7cfdb84
Reviewed-on: https://gerrit.instructure.com/100685
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-12-14 22:08:09 +00:00