Skip to content

Commit

Permalink
Refactors tests that were checking unnecessary attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
coconutcraig committed Nov 17, 2018
1 parent 5102744 commit 14802ff
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
21 changes: 21 additions & 0 deletions src/models/attendee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,24 @@ export default class Attendee extends Model implements AttendeeModel {
return this;
}
}

// attendee = (new Attendee)
// .named(first, last)
// .located({
// address,
// city,
// region,
// country,
// postcode,
// timezone,
// })
// .reachable({
// email,
// phone,
// cell_phone,
// work_phone,
// })
// .speaks(lang)
// .provided(notes)
// .messagable()
// .answers(answer | [answer, answer])
23 changes: 11 additions & 12 deletions src/models/preference.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import Preference from './preference';
it('sets the preference type to next available', async () => {
const preference = new Preference;

expect(preference.next()).toHaveProperty('attributes', {
day: null,
end: null,
start: null,
type: Preference.NEXT_AVAILABLE,
});
expect(preference.next().getAttributes()).toEqual(
expect.objectContaining({
type: Preference.NEXT_AVAILABLE,
})
);
});

it('sets the preference type to next available', async () => {
Expand Down Expand Up @@ -39,11 +38,11 @@ it('can set any of the available days', async () => {
days.forEach(day => {
const preference = new Preference;

expect(preference.on(day)).toHaveProperty('attributes', {
day,
end: null,
start: null,
type: Preference.CERTAIN_DAYS,
});
expect(preference.on(day).getAttributes()).toEqual(
expect.objectContaining({
day,
type: Preference.CERTAIN_DAYS,
})
);
});
});

0 comments on commit 14802ff

Please sign in to comment.