Skip to content

Instantly share code, notes, and snippets.

@magistrula
Created November 6, 2017 17:54
Show Gist options
  • Save magistrula/47c72d60cdc62c1dcb86d993420fb10b to your computer and use it in GitHub Desktop.
Save magistrula/47c72d60cdc62c1dcb86d993420fb10b to your computer and use it in GitHub Desktop.
ember-cli-page-object `getter` macro
import {
create,
hasClass,
isVisible
} from 'ember-cli-page-object';
import { getter } from 'ember-cli-page-object/macros';
// the old way
const page = create({
foo: isVisible('button'),
bar: hasClass('active', 'button')
baz: {
isDescriptor: true,
get() {
return this.foo && this.bar;
}
}
});
// the new way
const page = create({
foo: isVisible('button'),
bar: hasClass('active', 'button')
baz: getter(function() {
return this.foo && this.bar;
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment