/// <reference types="cypress" />

describe('location', () => {
  beforeEach(() => {
    cy.fixture('globals').as('globals')
    cy.fixture('master-data/location').as('location')
    cy.visit('/domain/el-cold-chain-warehouse/locations/4fae1820-b80c-4395-a13b-c09303d2d933?name=BUFFER%20ROOM')
    cy.waitGristLoad()
  })

  it('adds location', function () {
    const data = this.location.add1
    cy.addLocation(data)
    cy.clickSaveButton()
    cy.contains('span', 'data updated successfully').should('be.visible')
    cy.recordExists(data)  
  
  it('delete a location', function () {
    const data = this.location.deleteOne
    cy.checkLocationRecords([data.name])
    cy.clickDeleteButton()
    cy.clickPopupButton('delete')
    cy.contains('span', 'data deleted succesfully').should('be.visible')
    cy.contains('span', data.name).should('not.exist')
  })
  
  
   
  })
})

