{"size": 400, "ext": "js", "max_stars_repo_path": "src/behavioral/state/__tests__/Order.spec.js", "max_stars_repo_name": "helmuthdu/design-patterns-js", "max_stars_repo_stars_event_min_datetime": "2020-08-26T22:59:14.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-02T20:31:19.000Z", "max_issues_repo_path": "src/behavioral/state/__tests__/Order.spec.js", "max_issues_repo_name": "helmuthdu/design-patterns-js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/behavioral/state/__tests__/Order.spec.js", "max_forks_repo_name": "helmuthdu/design-patterns-js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.5714285714, "max_line_length": 59, "alphanum_fraction": 0.635}
import { expect } from 'chai';
import Order from '../Order';

describe('behavioral->state: Order', () => {
  it('should change order status', () => {
    const order = new Order();
    expect(order.state.name).to.equal('waitingForPayment');
    order.nextState();
    expect(order.state.name).to.equal('shipping');
    order.nextState();
    expect(order.state.name).to.equal('delivered');
  });
});
