const {sequelize} = require('./sequelize_index');
const {Restaurant} = require('./Restaurant');
const {Menu} = require('./Menu');
describe('Relationships', () => {
beforeAll(async () => {
await sequelize.sync({ force: true });
})
test('restaurants have menus', async () => {
const restaurant = await Restaurant.create({name: 'Ronalds', image: 'http://some.image.url'})
const menu = await Menu.create({title: 'set 1'});
await restaurant.addMenu(menu);
const menus = await restaurant.getMenus();
expect(menus[0].title).toBe('set 1');
})
})
TODO