Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 12 19:26
    cherifGsoul review_requested #5443
  • Dec 12 18:34
    cherifGsoul synchronize #5443
  • Dec 12 18:34

    cherifGsoul on document-inserted-removed-can6

    Update after review (compare)

  • Dec 12 17:44

    cherifGsoul on theme-3.0.0-pre.5

    (compare)

  • Dec 12 17:44

    cherifGsoul on master

    Update bit-doc-html-canjs (#544… (compare)

  • Dec 12 17:44
    cherifGsoul closed #5445
  • Dec 12 17:01
    cherifGsoul opened #5445
  • Dec 12 17:01

    cherifGsoul on theme-3.0.0-pre.5

    Update bit-doc-html-canjs Upda… (compare)

  • Dec 12 16:40

    cherifGsoul on update-api-page

    (compare)

  • Dec 12 16:39

    cherifGsoul on master

    Update API page (#5432) * Upda… (compare)

  • Dec 12 16:39
    cherifGsoul closed #5432
  • Dec 12 16:39
    cherifGsoul closed #5304
  • Dec 12 01:04
    greenkeeper[bot] commented #5392
  • Dec 12 01:04

    greenkeeper[bot] on core-js-3.5.0

    chore(package): update core-js … (compare)

  • Dec 11 18:34
    greenkeeper[bot] labeled #5444
  • Dec 11 18:34
    greenkeeper[bot] opened #5444
  • Dec 11 18:34

    greenkeeper[bot] on can-observable-mixin-1.0.7

    fix(package): update can-observ… (compare)

  • Dec 11 18:30

    cherifGsoul on update-infrastructure-page

    (compare)

  • Dec 11 18:30

    cherifGsoul on master

    Update infrastructure page with… (compare)

  • Dec 11 18:30
    cherifGsoul closed #5441
Andrei Balmus
@abalmush
Please let me know if you figure it out, I’ll post a message here as well
Gregg Roemhildt
@roemhildtg
:thumbsup:
Guido Smeets
@gsmeets
I am using mocha, but the principles are the same I reckon
I've made a few helper functions to easily render a component. The only tricky part is when you have fixtures for your data, which are collected async. So you need to add some promise to your viewmodels to ensure that they're loaded. I've done that generically for all my "functional" components.
Kevin Phillips
@phillipskevin
@abalmush can you post the error you're seeing?
Andrei Balmus
@abalmush
Hi @phillipskevin ok sure I will post it later, today.
Kevin Phillips
@phillipskevin
:thumbsup:
Andrei Balmus
@abalmush
I configured it from scratch, and I’m gettin another error:
Screen Shot 2018-09-15 at 11.09.21 PM.png
and this is the component it self
Screen Shot 2018-09-15 at 11.11.34 PM.png
that looks like something different, before it was that Jest didn’t see component initialization
I will try to reproduce later
Marc Godard
@MarcGodard
I have seen a way to do this, but cannot remember. I have a viewmodel variable that defaults to null, then gets set (this is a session type variable). Then in another viewmodel, once that is set, I want to update a variable, using get (). Just can't figure out how to do that anymore.
Any one know?
Andrei Balmus
@abalmush
@MarcGodard you can find a model of the component using can.viewModel - https://canjs.com/doc/can-view-model.html
Kevin Phillips
@phillipskevin
@abalmush are you using steal somewhere in your code?
Andrei Balmus
@abalmush
HI @phillipskevin nope, it comes from canjs package map/backup/backup
as per stack trace
if I creat component inside my test file no issues )
The only thing I do in my code is this: import ‘can/map/backup/backup’;
so I can backup my Map and restore it if needed
Kevin Phillips
@phillipskevin
ok, I'll take a look
oh, just because all can packages are using steal syntax in 2.x
Andrei Balmus
@abalmush
OK sure thank you. Btw this is old canjs 2.3
yeah
Kevin Phillips
@phillipskevin
I'm not sure exactly how to configure Jest to work with this global variable
I'm sure someone has done it hough
Andrei Balmus
@abalmush
Yeah, I will return back to this issue and try to resolve it some urgent stuff popped up and I have to postpone it.
Kevin Phillips
@phillipskevin
ok
@MarcGodard you would do something like this
// parent-view-model.js
ViewModel: {
    sessionPromise: {
        default() {
            return Session.get({});
        }
    }
}
// child-view-model.js
ViewModel: {
    sessionPromise: "any",

    session: {
        get(lastSet, resolve) {
            if (this.sessionPromise) {
                this.sessionPromise.then(resolve);
            }
        }
    }
}
Kevin Phillips
@phillipskevin
and then pass the sessionPromise from the parent to the child through a binding
Marc Godard
@MarcGodard
@phillipskevin Thanks, thats what I was looking for
Kevin Phillips
@phillipskevin
:thumbsup:
Andrei Balmus
@abalmush
Hah, I completely misunderstood the question :) sorry
Justin Meyer
@justinbmeyer
Justin Meyer
@justinbmeyer
@/all I need some epic bike-shedding on: canjs/canjs#4472
Kevin Phillips
@phillipskevin
More sections of the Testing Guide have been published: https://canjs.com/doc/guides/testing.html
It now includes:
Testing Components (which was published last week but I don't think I announced)
Testing Routing
Viktor Busko
@Lighttree
events: {
        '.showMore enter': function (...args) {
            console.log('enter', args);
        },

        '.showMore click': function (...args) {
            console.log('click', args);
        }
    }
In this example Enter key press calls click as well. Is there way to avoid this ? Isn't this a bug ?
Jeroen Cornelissen
@jeroencornelissen
@Lighttree I think that’s just browser behaviour. If a <button> is focused you can press enter or space key and that will trigger the click event.
Do you need the .showMore enter event?
Viktor Busko
@Lighttree

yeah this obvious, I was thinking that this "special" enter event split internally mouse click and keyboard enter event.

Do you need the .showMore enter event?

Yes, I need slightly different behavior depends user use keyboard or mouse.

I probably can use just click and verify source internally
Viktor Busko
@Lighttree
Marc Godard
@MarcGodard
is there a way in a helper to know if it used {{{...}}} or {{...}}?
Viktor Busko
@Lighttree
I'm not sure, but I suspect that answer is "no", because {{{...}}} and {{...}} part of stache expressions in general, not specific to helper.
Kevin Phillips
@phillipskevin
@/all the final pieces of the Testing Guide have been published: https://canjs.com/doc/guides/testing.html :tada: :tada:
It now covers:
  • ViewModels
  • Components
  • Routing
  • Models
  • Integration Testing
Viktor Busko
@Lighttree
awesome
Ngaosathe
@ThekhoN
Does canjs 2.3 use pushState for implementing the route changes?
Frank Lemanschik
@frank-dspeed
i think donejs below 1 till 1 is using canjs 2.x