Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
25dcee3
WIP(ui-top-nav-bar): wip
balzss Aug 14, 2024
5bafd81
WIP(ui-top-nav-bar): wip
balzss Aug 22, 2024
0cd034c
WIP(ui-top-nav-bar): add item and itemlist
joyenjoyer Sep 13, 2024
901dd8b
WIP(ui-top-nav-bar): some refactor
joyenjoyer Sep 13, 2024
793f46d
WIP(ui-top-nav-bar): add lightMode
joyenjoyer Sep 13, 2024
aeb903f
WIP: add WrapperComponent to test resizing
joyenjoyer Sep 20, 2024
d54fd13
WIP(ui-top-nav-bar): add desktop topnav
joyenjoyer Nov 14, 2024
a5a85a8
WIP(ui-top-nav-bar): some refactoring
joyenjoyer Nov 17, 2024
7a1a571
WIP(ui-top-nav-bar): inject lightMode
joyenjoyer Nov 18, 2024
070b941
WIP(ui-top-nav-bar): clean DesktopTopNav
joyenjoyer Nov 26, 2024
65449b9
WIP(ui-top-nav-bar): api rework
joyenjoyer Nov 28, 2024
df12838
WIP(ui-top-nav-bar): finetuning after grooming meeting
joyenjoyer Nov 28, 2024
2a08610
WIP(ui-top-nav-bar): add more changes after review
joyenjoyer Nov 29, 2024
e7798c3
WIP(ui-top-nav-bar): fix build errors
joyenjoyer Dec 2, 2024
c8934d0
WIP(ui-top-nav-bar): clear index.tsx and create a basic menu structure
joyenjoyer Dec 4, 2024
5d741e7
WIP: add smart menu navigation
joyenjoyer Dec 5, 2024
079cd9d
WIP: refine menu handling
joyenjoyer Dec 6, 2024
615fb44
WIP(ui-top-nav-bar): refinement
joyenjoyer Dec 6, 2024
4014ab6
WIP(ui-top-nav-bar): add withStyle to CanvasTopNav
joyenjoyer Dec 13, 2024
fff50f7
WIP(ui-top-nav-bar): refactor
joyenjoyer Dec 13, 2024
b69827b
WIP: add onClick for help
joyenjoyer Dec 13, 2024
d246229
WIP(ui-top-nav-bar): add subnav
joyenjoyer Feb 4, 2025
0d72441
WIP(ui-top-nav-bar): add subnav
joyenjoyer Feb 10, 2025
a50864c
WIP(ui-top-nav-bar): add subnav styles
joyenjoyer Feb 21, 2025
07c8a1b
WIP(ui-top-nav-bar): improve types
joyenjoyer Feb 21, 2025
0423fb3
WIP(shared-types,ui-drilldown,ui-top-nav-bar): add lti colors
joyenjoyer Feb 28, 2025
11889e5
WIP(emotion,ui-drilldown,ui-top-nav-bar): add sidenav
joyenjoyer Mar 13, 2025
66ad630
feat(ui-top-nav-bar): add buttons prop
joyenjoyer Mar 19, 2025
9545953
feat(ui-top-nav-bar,ui-drilldown): adjust types
joyenjoyer Mar 19, 2025
338d4a7
feat(ui-themes,shared-types): add new colors
joyenjoyer Mar 19, 2025
84efd69
feat(ui-top-nav-bar): add stuff
joyenjoyer Mar 20, 2025
f7a31e6
feat(ui-top-nav-bar): add tray
joyenjoyer Mar 21, 2025
9ed570a
feat: replace href to onclick
joyenjoyer Mar 21, 2025
cb9ce7e
chore(ui-top-nav-bar): integrate useStyle into SubNav to aid testing
joyenjoyer Apr 10, 2025
5d32308
chore(ui-top-nav-bar): finetune subnav
joyenjoyer Apr 10, 2025
9ed3eec
chore(ui-top-nav-bar): add stuff
joyenjoyer Apr 11, 2025
617a43e
chore(ui-top-nav-bar): add LTI
joyenjoyer Apr 14, 2025
a5ffe3d
refactor(ui-top-nav-bar,shared-types): add useStyle
joyenjoyer Apr 24, 2025
5ff13c9
refactor(ui-top-nav-bar): fix svg
joyenjoyer Apr 24, 2025
75d54c8
refactor(ui-top-nav-bar): fix style stuff
joyenjoyer Apr 29, 2025
a994015
chore(ui-top-nav-bar): add DeepPartial theme
joyenjoyer Apr 29, 2025
e3c410f
refactor(ui-top-nav-bar): asddsads
joyenjoyer May 5, 2025
6dfddba
chore(ui-top-nav-bar,ui-drilldown,emotion): kk
joyenjoyer May 25, 2025
38a1538
refactor(ui-top-nav-bar): add submenu pages
joyenjoyer May 28, 2025
38f2e32
feat(ui-top-nav-bar,shared-types): style fix
joyenjoyer Jun 5, 2025
01b66ab
refactor(ui-top-nav-bar): change api
joyenjoyer Jun 24, 2025
b236c78
test(ui-top-nav-bar): add tests
git-nandor Jun 25, 2025
a9760d9
test: playground for testing
joyenjoyer Jun 27, 2025
32d22e3
refactor: :wq
joyenjoyer Jun 27, 2025
d2e1480
refactor: window fix
joyenjoyer Jul 3, 2025
c71f910
Fix e2e CanvasTopNav tests
git-nandor Jul 4, 2025
67850f1
test: add submenu to LTI menulist
joyenjoyer Jul 7, 2025
bb5669a
feat: remove todos
joyenjoyer Jul 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import { defineConfig } from 'cypress'
import { defineConfig } from "cypress";

// TODO figure out why this isn't working:
// import webpackConfig from '@instructure/ui-webpack-config'
// eslint-disable-next-line @instructure/no-relative-imports
import webpackConfig from './packages/ui-karma-config/lib/legacyBaseWebpackConfig'
import webpackConfig from "./packages/ui-karma-config/lib/legacyBaseWebpackConfig";

export default defineConfig({
numTestsKeptInMemory: 1,
Expand All @@ -37,21 +37,29 @@ export default defineConfig({
execTimeout: 120000,
taskTimeout: 60000,
retries: {
experimentalStrategy: 'detect-flake-and-pass-on-threshold',
experimentalStrategy: "detect-flake-and-pass-on-threshold",
experimentalOptions: {
maxRetries: 10,
passesRequired: 1
maxRetries: 2,
passesRequired: 1,
},
openMode: true,
runMode: true
runMode: true,
},

screenshotOnRunFailure: false,

component: {
excludeSpecPattern: 'regression-test/**',
excludeSpecPattern: "regression-test/**",
devServer: {
framework: 'react',
bundler: 'webpack',
webpackConfig
}
}
})
framework: "react",
bundler: "webpack",
webpackConfig,
},
},

e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
67 changes: 67 additions & 0 deletions cypress/component/SubNav.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 - present Instructure, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import React from 'react'
import { SubNav } from '../../packages/ui-top-nav-bar'
import '../support/component'
import 'cypress-real-events'


describe('<SubNav/>', () => {
it('should call onClick and redirect when item is clicked', async () => {
const onClickSpy = cy.spy().as('onClickSpy')

cy.mount(
<SubNav
menuItems={[
{ title: 'Home', href: '#', selected: true },
{ title: 'Announcements', href: '#', selected: false },
{ title: 'Assignments', href: '#-test', selected: false, onClick: onClickSpy }
]}
/>
)
cy.contains('Assignments').realClick()

cy.get('@onClickSpy').should('have.been.called')
cy.url().should('contain', '#-test')
})

it('should be able to select with keyboard', async () => {
const onClickSpy = cy.spy().as('onClickSpy')
cy.mount(
<SubNav
menuItems={[
{ title: 'Home', href: '#'},
{ title: 'Announcements', href: '#-test2', selected: false, onClick: onClickSpy },
{ title: 'Assignments', href: '#-test', selected: true }
]}
/>
)
cy.contains('Home').focus()
cy.realPress(['Tab']).wait(100)
cy.realPress(['Enter']).wait(100)

cy.get('@onClickSpy').should('have.been.called')
cy.url().should('contain', '#-test2')
})
})
Loading