customer.e2e.cy.ts
angular/examples/week07-08/customer.e2e.cy.ts
// @ts-nocheck
describe('Customer CRUD', () => {
beforeEach(() => {
cy.intercept('GET', '/api/customers', { fixture: 'customers.json' }).as('loadCustomers');
cy.visit('/customers');
cy.wait('@loadCustomers');
});
it('creates a new customer', () => {
cy.contains('New Customer').click();
cy.get('input[formcontrolname="name"]').type('Grace Hopper');
cy.get('input[formcontrolname="email"]').type('grace@example.com');
cy.get('select[formcontrolname="status"]').select('active');
cy.intercept('POST', '/api/customers', {
id: '999',
name: 'Grace Hopper',
email: 'grace@example.com',
status: 'active',
}).as('createCustomer');
cy.contains('Save').click();
cy.wait('@createCustomer');
cy.contains('Grace Hopper').should('exist');
});
});
관련 글
server.js
server.js — javascript source code from the angular learning materials (angular/comprehensive-demo/server/server.js).
글 읽기 →app.component.ts
app.component.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.component.ts).
글 읽기 →app.config.ts
app.config.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.config.ts).
글 읽기 →app.routes.ts
app.routes.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.routes.ts).
글 읽기 →auth.guard.ts
auth.guard.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/core/guards/auth.guard.ts).
글 읽기 →role.guard.ts
role.guard.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/core/guards/role.guard.ts).
글 읽기 →