Commit Graph

43 Commits

Author SHA1 Message Date
Steve Howell
0b0c57bbe0 zjquery: Throw Error() object to get tracebacks.
If you throw a raw string in node, you don't get a traceback.
2017-05-31 09:10:43 -07:00
Steve Howell
689605dd2e Introduce make_zjquery(). 2017-05-24 17:41:41 -07:00
Steve Howell
46e72289d1 Add features to zjquery. 2017-05-24 17:41:41 -07:00
Steve Howell
4a062d47a6 Add more features to zjquery. 2017-05-24 13:08:54 -07:00
Steve Howell
1cb58d72b2 zjquery: Add focus/blur methods. 2017-05-23 18:52:25 -07:00
Steve Howell
cd08bbe7d8 zjquery: Add array-like functionality to elements.
(We simulate the behavior that a jquery object looks like an
array, but also has methods that can be called as if it were a
scalar.)
2017-05-23 18:52:25 -07:00
Steve Howell
4c520780a1 zjquery: Support $(func) flavor of $() calls. 2017-05-23 18:52:25 -07:00
Joshua Pan
f3369b266a node_tests: Extract and create fake_jquery as zjquery.
This allows us to use fake_jquery (originally only in
compose_actions.js) in all our node tests.
2017-05-23 10:27:07 -07:00
adnrs96
a91012bd70 Move thirdparty-fonts.css from static/styles to static/third. 2017-03-21 13:40:05 -07:00
Steve Howell
ef3033c79e node tests: Make with_overrides() more granular.
The with_overrides() function no longer works at the module
level, so you can temporarily override one function in a module
without breaking more permanent monkey patches.

This makes us slightly more vulnerable to unintentional test
leakages, but it solves the problem where you often need lots
of temporary overrides for writer functions but you want to
keep a more permanent override for some sort of reader function.
2017-03-13 15:09:53 -07:00
Steve Howell
a98999ce27 node tests: Extract with_overrides() helper.
The function with_overrides() uses the logic from the old
run() function in dispatch.js to allow you to call a test
function and override parts of the global namespace only
for the duration of when test_function runs.
2017-03-13 15:09:53 -07:00
Steve Howell
51c57bb05d node tests: Add with_stub() helper. 2017-03-13 15:09:53 -07:00
Tim Abbott
f037979fe0 zjsunit: Don't run tests on editor backup files. 2017-03-01 22:43:19 -08:00
Rafid Aslam
84e802422e deps: Upgrade and move underscore.js from static/third to npm
- Remove `underscore.js` from `static/third` and fetch it from `npm`.
- Upgrade `underscore.js` to 1.8.3.
- Bump up the `PROVISION_VERSION` to 4.2.

Part of #1709
2017-01-19 17:07:45 -08:00
Rafid Aslam
911fcd3831 deps: Upgrade and move codepointat from static/third to npm
- Remove `codepointat` from `static/third` and fetch it from `npm`.
- Upgrade `codepointat` to 0.2.0.
- Bump up the `PROVISION_VERSION` to 4.1.

Part of #1709.
2017-01-19 17:07:32 -08:00
Rafid Aslam
0290aeb6ab lint: Fix several no-unused-vars eslint rule violations.
These changes were extracted by tabbott from the original commit
to merge now because they have been reviewed as safe.
2016-12-03 18:43:47 -08:00
Tim Abbott
1a161c6e33 eslint: Fix comma-dangle rules in JS support files.
This was done via eslint --fix.
2016-12-03 15:00:24 -08:00
Tommy Ip
b3f4feb996 eslint: change max-len from warning to error and fix violations. 2016-12-02 14:16:33 +00:00
Tommy Ip
c90da24541 eslint: change keyword-spacing from warning to error and fix violations. 2016-12-01 14:22:15 -08:00
Steve Howell
d953eca14c Make group PMs reply-to's more consistent in case.
We now sort lists of users ids deterministically, and we also
sort list of emails deterministically and without regard to case.

This probably fixes the bug #2343, although I never got a great
repro on that.
2016-11-26 11:48:52 -08:00
Steve Howell
578b276523 node tests: Add tests for message_store.js. 2016-11-26 11:48:52 -08:00
Steve Howell
6fe86adac8 node tests: Add newer stylesheets for HTML output. 2016-11-05 15:03:29 -07:00
Steve Howell
dae53573cb node tests: Fix make_sure_all_templates_have_been_compiled().
This now searches subdirectories.
2016-11-04 21:23:35 -07:00
Steve Howell
3d0c0e2e81 node tests: Remove retry logic for compiling templates.
We can now use template_finder.get() to find the name we need.
2016-11-04 21:23:35 -07:00
Steve Howell
a2874a3fe9 node tests: Simplify compiling of templates.
Now we just have two methods of importance:

    compile_template
    render_template

The compile_template() function will automatically
(and recursively) compile any partials it depends
on and mark those as compiled.
2016-11-04 11:23:11 -07:00
Steve Howell
0085164ad9 node tests: Avoid re-compiling templates.
This is a minor optimization to avoid re-compiling templates
that have already encountered.
2016-11-04 11:23:11 -07:00
Steve Howell
dd4a8eeebd node tests: Extract render.find_included_partials(). 2016-11-04 11:23:11 -07:00
Steve Howell
155f7881b2 node tests: Extact template_finder() class. 2016-11-04 11:23:11 -07:00
Steve Howell
61d88cfc13 node tests: Use template_dir() to walk templates. 2016-11-04 11:23:11 -07:00
Brock Whittaker
1432c6613b zjsunit: Remove manual need to call global.use_template.
When the render function is run now, it uses the partial_finder
function to search recursively through files for partials and add them
so that test writers don’t have to.

This means that we no longer have to do any manual work to maintain
the templates.js check that all handlebars templates are rendered by
the node tests.
2016-11-02 22:08:47 -07:00
Brock Whittaker
ff3d5ca4db Separate display settings from settings_tab.handlebars.
This separates the display settings module from the
settings_table.handlebars template.

Additionally, it fixes the node tests to search in the
static/templates/settings directory and initialize any templates in there
while running tests on the settings templates.
2016-10-05 22:26:40 -07:00
Sahil Dua
058587da77 Remove extra new lines at the ends of Zulip authoried files.
Fixes #1627.

[tweaked by tabbott to avoid patching third-party modules, for now]
2016-09-26 21:05:24 -07:00
Tim Abbott
c454b180e0 zjsunit: Fix running coverage.
Previously, we would end up treating the command-line arguments to
"instanbul cover" as filenames.
2016-08-25 19:51:50 -07:00
Steve Howell
4dbeb66a4c tests: Add render.init() to node tests.
This makes sure we are explicit about partials in
individual test modules.  Eventually, we should figure
out a way to make partials automatically compile as
part of the node tests.
2016-08-25 13:56:08 -07:00
Steve Howell
48af751e8d Clean up server_events.js (minor stuff).
Make exceptions more clear and upstream patching of builtins to index.js.
2016-08-09 18:49:13 -07:00
Steve Howell
cdd03dec4d Extract media queries to media.css.
Create `media.css` using media queries that had been at the bottom
of `zulip.css`, then update miscellaneous setttings/docs files.

I also add `.screen-medium-show` and `.screen-narrow-show` to
`media.css`, as they seem to be an important part of our
responsive design.

Fixes #1532.
2016-08-05 10:32:55 -07:00
Steve Howell
ebe76dd2c3 Add stub_out_jquery() for node tests. 2016-07-30 14:54:30 -07:00
Steve Howell
2fe78dc691 Fix leaky requires between zjsunit tests.
Some node tests used to pass as long as prior tests ran,
but then they would fail if you ran them standalone.  Now
we are more aggressive about cleaning up node's require
cache after each individual test runs.
2016-07-30 14:54:30 -07:00
Steve Howell
2e254547b2 Extracted zjsunit/finder.js
This introduces a very minor different in behavior if you specify
an invalid filename as a command line argument.  We now show
warnings for those *before* running the rest of the tests.
2016-07-30 14:54:30 -07:00
Steve Howell
643f2e03e0 Extracted zjsunit/output.js 2016-07-30 14:54:30 -07:00
Steve Howell
b3bc829f61 Extracted zjsunit/render.js 2016-07-30 14:54:30 -07:00
Steve Howell
9acbff3c83 Extracted zjsunit/namespace.js 2016-07-30 14:54:30 -07:00
Steve Howell
6a65b3482c Move index.js to frontend_tests/zjsunit. 2016-07-30 14:54:30 -07:00