Skip to content

Commit

Permalink
chore: adjust nav visuals
Browse files Browse the repository at this point in the history
  • Loading branch information
hirsch88 committed Jan 29, 2024
1 parent 7f49805 commit 7edb30f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 59 deletions.
11 changes: 5 additions & 6 deletions test/cypress/e2e/visual/bal-nav-part-1.visual.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Platforms } from '../../../src/types'
import { compareSnapshotOptions } from './snapshot-util'

describe('bal-nav - desktop', () => {
testNavigationOnDesktop('widescreen')
Expand All @@ -13,12 +12,12 @@ describe('bal-nav - desktop', () => {
})

it('closed menu on top', () => {
cy.compareSnapshot(`nav-desktop-${platform}-closed-top`, compareSnapshotOptions(platform, 0, 0, 0.2))
cy.compareSnapshot(`nav-desktop-${platform}-closed-top`, 0.2)
})

it('closed menu on bottom', () => {
cy.scrollTo('bottom')
cy.compareSnapshot(`nav-desktop-${platform}-closed-bottom`, compareSnapshotOptions(platform, 0, 200, 0.2))
cy.compareSnapshot(`nav-desktop-${platform}-closed-bottom`, 0.2)
})

it('open menu', () => {
Expand All @@ -29,7 +28,7 @@ describe('bal-nav - desktop', () => {
.find('button')
.click()
cy.wait(400)
cy.compareSnapshot(`nav-desktop-${platform}-open`, compareSnapshotOptions(platform, 0, 0, 0.2))
cy.compareSnapshot(`nav-desktop-${platform}-open`, 0.2)
})

it('open menu second tab', () => {
Expand All @@ -40,13 +39,13 @@ describe('bal-nav - desktop', () => {
.find('button')
.click()
cy.wait(400)
cy.compareSnapshot(`nav-desktop-${platform}-open-menu-second-tab`, compareSnapshotOptions(platform, 0, 0, 0.2))
cy.compareSnapshot(`nav-desktop-${platform}-open-menu-second-tab`, 0.2)
})

it('open search popoup', () => {
cy.getByTestId('basic').find('#bal-nav__meta-buttons').eq(0).click()
cy.wait(400)
cy.compareSnapshot(`nav-desktop-${platform}-open-search-popup`, compareSnapshotOptions(platform, 0, 0, 0.2))
cy.compareSnapshot(`nav-desktop-${platform}-open-search-popup`, 0.2)
})
})
}
Expand Down
7 changes: 3 additions & 4 deletions test/cypress/e2e/visual/bal-nav-part-2.visual.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Platforms } from '../../../src/types'
import { compareSnapshotOptions } from './snapshot-util'

describe('bal-nav - touch', () => {
testNavigationOnTouch('tablet')
Expand All @@ -12,20 +11,20 @@ describe('bal-nav - touch', () => {
})

it('closed menu on top', () => {
cy.compareSnapshot(`nav-touch-${platform}-closed-top`, compareSnapshotOptions(platform, 0, 0, 0.2))
cy.compareSnapshot(`nav-touch-${platform}-closed-top`, 0.2)
})

it('closed menu on bottom', () => {
cy.scrollTo('bottom')
cy.wait(400)
cy.compareSnapshot(`nav-touch-${platform}-closed-bottom`, compareSnapshotOptions(platform, 0, 200, 0.2))
cy.compareSnapshot(`nav-touch-${platform}-closed-bottom`, 0.2)
})

it('open menu', () => {
cy.scrollTo('top')
cy.getByTestId('basic').find('.bal-nav-meta-bar').find('bal-stack > bal-button').eq(1).click()
cy.wait(400)
cy.compareSnapshot(`nav-touch-${platform}-open`, compareSnapshotOptions(platform, 0, 0, 0.2))
cy.compareSnapshot(`nav-touch-${platform}-open`, 0.2)
})
})
}
Expand Down
7 changes: 3 additions & 4 deletions test/cypress/e2e/visual/bal-nav-part-3.visual.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Platforms } from '../../../src/types'
import { compareSnapshotOptions } from './snapshot-util'

describe('bal-nav - colors', () => {
testNavigationOnDesktop('widescreen')
Expand All @@ -13,7 +12,7 @@ describe('bal-nav - colors', () => {
it('open menu', () => {
cy.contains('Versichern').click()
cy.wait(400)
cy.compareSnapshot(`nav-colors-desktop-${platform}-open`, compareSnapshotOptions(platform, 0, 0, 0.2))
cy.compareSnapshot(`nav-colors-desktop-${platform}-open`, 0.2)
})
})
}
Expand All @@ -24,14 +23,14 @@ describe('bal-nav - long', () => {
it('mobile', () => {
cy.platform('mobile').visit('/components/bal-nav/test/bal-nav-long.visual.html').waitForDesignSystem()
cy.getByTestId('basic').find('.bal-nav-meta-bar').find('bal-stack > bal-button').eq(1).click()
cy.compareSnapshot(`nav-long-mobile-open`, compareSnapshotOptions('mobile', 0, 0, 0.2))
cy.compareSnapshot(`nav-long-mobile-open`, 0.2)
})

it('desktop', () => {
cy.platform('desktop').visit('/components/bal-nav/test/bal-nav-long.visual.html').waitForDesignSystem()
cy.contains('Versichern').click()
cy.wait(400)
cy.compareSnapshot(`nav-long-desktop-open`, compareSnapshotOptions('desktop', 0, 0, 0.2))
cy.compareSnapshot(`nav-long-desktop-open`, 0.2)
})
})
})
15 changes: 7 additions & 8 deletions test/cypress/e2e/visual/bal-navigation.visual.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Platforms } from '../../support/utils'
import { compareSnapshotOptions } from './snapshot-util'

describe('bal-navigation', () => {
testNavigationOnDesktop('widescreen')
Expand All @@ -19,16 +18,16 @@ describe('bal-navigation', () => {
})

it('closed menu on top', () => {
cy.compareSnapshot(`navigation-desktop-${platform}-closed-top`, compareSnapshotOptions(platform, 0, 0))
cy.compareSnapshot(`navigation-desktop-${platform}-closed-top`, 0.2)
})
it('closed menu on bottom', () => {
cy.scrollTo('bottom')
cy.compareSnapshot(`navigation-desktop-${platform}-closed-bottom`, compareSnapshotOptions(platform, 0, 200))
cy.compareSnapshot(`navigation-desktop-${platform}-closed-bottom`, 0.2)
})
it('open menu', () => {
cy.contains('Versichern').click()
cy.wait(400)
cy.compareSnapshot(`navigation-desktop-${platform}-open`, compareSnapshotOptions(platform, 0, 0))
cy.compareSnapshot(`navigation-desktop-${platform}-open`, 0.2)
})
})
}
Expand All @@ -40,16 +39,16 @@ describe('bal-navigation', () => {
})

it('closed menu on top', () => {
cy.compareSnapshot(`navigation-touch-${platform}-closed-top`, compareSnapshotOptions(platform, 0, 0))
cy.compareSnapshot(`navigation-touch-${platform}-closed-top`, 0.2)
})
it('closed menu on bottom', () => {
cy.scrollTo('bottom')
cy.compareSnapshot(`navigation-touch-${platform}-closed-bottom`, compareSnapshotOptions(platform, 0, 200))
cy.compareSnapshot(`navigation-touch-${platform}-closed-bottom`, 0.2)
})
it('open menu', () => {
cy.scrollTo('top')
cy.getByTestId('navigation-burger').click()
cy.compareSnapshot(`navigation-touch-${platform}-open`, compareSnapshotOptions(platform, 0, 0))
cy.compareSnapshot(`navigation-touch-${platform}-open`, 0.2)
})
})
}
Expand All @@ -69,7 +68,7 @@ describe('bal-navigation-colors', () => {
it('open menu', () => {
cy.contains('Versichern').click()
cy.wait(400)
cy.compareSnapshot(`navigation-colors-desktop-${platform}-open`, compareSnapshotOptions(platform, 0, 0))
cy.compareSnapshot(`navigation-colors-desktop-${platform}-open`, 0.2)
})
})
}
Expand Down
37 changes: 0 additions & 37 deletions test/cypress/e2e/visual/snapshot-util.ts

This file was deleted.

0 comments on commit 7edb30f

Please sign in to comment.