Giter Club home page Giter Club logo

Comments (6)

san650 avatar san650 commented on May 22, 2024

Hi @leonardocsouza, this is an issue indeed!

We detected this issue some days ago but I forgot to open an issue to let everyone else to be aware of it, thanks for reporting the issue.

We're working on a fix for it, see #62 specially the commit b09dd00

For now, another workaround is to wrap the component in a customHelper, for example

let flaggingMenu = customHelper(function(selector) {
  return {
    scope: `${selector} .flagging-menu`,
    isOpen: hasClass('is-open'),

    selectCurrent: clickable('.mark.current'),
    selectPast: clickable('.mark.past'),
    selectUrgent: clickable('.mark.urgent')
  };
});

let topics = collection({
  itemScope: '.topic',
  item: {
    title: text('.title'),
    flaggingMenu
  }
});

Please, let me know if this works for you.

from ember-cli-page-object.

leonardocsouza avatar leonardocsouza commented on May 22, 2024

Thank you SO much for the quick and detailed reply!

I thought a customHelper could be a good solution, but had not tried that yet. I've just tested it now with the info you shared above and it seems like I may be missing some step to get it to work because it just comes back as a plain javascript Object as if it didn't get initialized or something like that.

image

In any case, we have a workaround that solves the problem for now, and I have it wrapped in a test helper so that whenever the fix for this is released I can just replace it in one place.

Thank you again!

Best,
Leo

from ember-cli-page-object.

san650 avatar san650 commented on May 22, 2024

Yes, you are right, let me fix the example so others can use it.

let menu = customHelper(function(selector) {
  return {
    scope: selector,
    isOpen: hasClass('is-open'),

    selectCurrent: clickable('.mark.current'),
    selectPast: clickable('.mark.past'),
    selectUrgent: clickable('.mark.urgent')
  };
});

let topics = collection({
  itemScope: '.topic',
  item: {
    title: text('.title'),
    flaggingMenu: menu('.flagging-menu')
  }
});

customHelper always returns a function, and the selector you pass to it will be scoped to the item level.

Although this is just a workaround for the issue you posted, it's a nice example of the power of the customHelper.

Cheers

from ember-cli-page-object.

san650 avatar san650 commented on May 22, 2024

Fixed by #62

from ember-cli-page-object.

san650 avatar san650 commented on May 22, 2024

@leonardocsouza the fix is included on version 0.8.1. Thanks again for your report!

https://github.com/san650/ember-cli-page-object/releases/tag/v0.8.1

from ember-cli-page-object.

leonardocsouza avatar leonardocsouza commented on May 22, 2024

Awesome! Thank you for the update and for the fix! :) 👍

from ember-cli-page-object.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.