Created
February 3, 2025 16:54
-
-
Save joegaudet/4d7e12e5725b8af63c0735f831cd3a6c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FormFixture extends Fixture { | |
@element submitButton; | |
submit() { | |
this.submitButton.click(); | |
} | |
} | |
class FooFixture extends FormFixture { | |
constructor() { | |
super('data-test-root'); | |
} | |
@element emailField; | |
@element commitButton; | |
@element label; | |
async enterEmail(email) { | |
await this.emailField.fillIn(email); | |
return this.commitButton.click(); | |
} | |
} | |
const fixture = new FooFixture(); | |
describe("foo form', function() { | |
// embjs front matter | |
it('renders', function() { | |
fixture.should.be.rendered | |
}); | |
it('submits the form', function() { | |
fixture.enterEmail('[email protected]'); | |
fxiture.submit(); | |
label.should.haveText('Success'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment