Commit Graph

11 Commits

Author SHA1 Message Date
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