Skip to content

Instantly share code, notes, and snippets.

Given the following code and test, implement the ChangeSet class and attribute es6 decorator so that the tests pass. The code should be valid typescript code.

class ChangeSet {

}

class User extends ChangeSet {
@attribute name: string;
@attribute age: number;
class FormFixture extends Fixture {
@element submitButton;
submit() {
this.submitButton.click();
}
}
class FooFixture extends FormFixture {
constructor() {
@joegaudet
joegaudet / machine.js
Last active May 10, 2022 18:44
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine(
{
initial: 'intro',
context: {
title: '',
ctaTitle: '',
},
states: {
intro: {
on: {
const machine = Machine(
{
initial: 'intro',
context: {
title: '',
ctaTitle: '',
},
states: {
intro: {
on: {
SSLProxyEngine On
AddOutputFilterByType DEFLATE text/html text/plain text/css text/css text/javascript application/javascript
AddOutputFilterByType INFLATE text/xml text/xsl
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
Redirect /wp-admin/install.php https://maintenance.food.ee
with formated_order_items as (
select oi.id,
o.id as order_id,
oi.quantity,
(string_agg(oi.quantity || ' - ' || mi.name, CHR(10))) as description,
string_agg(mog.verb || ' ' || moi.name, ',') as pickles,
string_agg(dt.name, ',') as dietary_tags
from order_items oi
join menu_items mi on oi.menu_item_id = mi.id
join order_item_menu_option_items oimoi on oi.id = oimoi.order_item_id
@joegaudet
joegaudet / cypress-ember-data-hooks.js
Created July 8, 2020 00:14
Some cypress commands to work with ember-data
// use ember-expose-global and replace MyAppName with you
Cypress.Commands.add("getStore", () => {
return cy
.window()
.then((win) => cy.wrap(win.MyAppName.__container__.lookup('service:store')));
});
/**
* Create Record
* @param {string} Record Name
@joegaudet
joegaudet / cypress-ember-data-hooks.js
Created July 8, 2020 00:14
Some cypress commands to work with ember-data
// use ember-expose-global and replace MyAppName with you
Cypress.Commands.add("getStore", () => {
return cy
.window()
.then((win) => cy.wrap(win.MyAppName.__container__.lookup('service:store')));
});
/**
* Create Record
* @param {string} Record Name
Cypress.Commands.add("settleAppPromises", () => {
return cy.window()
.then(win => cy.waitUntil(() => win.SwiftFox.__container__.lookup('service:settledPromiseQueue').isEmpty));
});
Cypress.Commands.overwrite('click', (originalFn) => {
cy.settleAppPromises();
return originalFn();
});
const closed = 2;
const closed_2 = 3;
[1,2,3]
.filter(_ => _ > closed)
.map(_ => _ * closed_3);