add test for no carriers to display

This commit is contained in:
Yisroel Baum 2025-11-09 21:02:59 +02:00
parent 0400282b03
commit 2e7d67adde
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 8 additions and 3 deletions

View file

@ -1,8 +1,6 @@
describe('freight carriers', () => { describe('freight carriers', () => {
beforeEach(() => {
cy.exec('npm run db:seed')
})
it('creates freight carrier', () => { it('creates freight carrier', () => {
cy.exec('npm run db:seed')
cy.visit('/freight_carriers') cy.visit('/freight_carriers')
cy.get('input[name=companyName]').type('test company') cy.get('input[name=companyName]').type('test company')
cy.get('input[name=contact_person]').type('Joe Shmoe') cy.get('input[name=contact_person]').type('Joe Shmoe')
@ -12,4 +10,9 @@ describe('freight carriers', () => {
cy.url().should('include', '/freight_carriers') cy.url().should('include', '/freight_carriers')
cy.get('table').contains('test company') cy.get('table').contains('test company')
}) })
it('shows message if no carriers to display', () => {
cy.exec('npm run db:wipe')
cy.visit('/freight_carriers')
cy.contains('No Carriers to Display')
})
}) })

View file

@ -39,6 +39,8 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% else %}
<p>No Carriers to Display</p>
{% endif %} {% endif %}
</body> </body>
</html> </html>