Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
deundrewilliams committed Aug 22, 2022
1 parent 57ebde4 commit f5ce0e2
Show file tree
Hide file tree
Showing 113 changed files with 6,819 additions and 922 deletions.
67 changes: 62 additions & 5 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,61 @@
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "deundrewilliams",
"name": "deundrewilliams",
"avatar_url": "https://avatars.githubusercontent.com/u/41072160?v=4",
"profile": "https://github.com/deundrewilliams",
"contributions": [
"code",
"review",
"test"
]
},
{
"login": "SJJacques",
"name": "Steve Jacques",
"avatar_url": "https://avatars.githubusercontent.com/u/71739913?v=4",
"profile": "https://github.com/SJJacques",
"contributions": [
"code",
"test",
"review",
"bug"
]
},
{
"login": "walid-i",
"name": "walid-i",
"avatar_url": "https://avatars.githubusercontent.com/u/57739844?v=4",
"profile": "https://github.com/walid-i",
"contributions": [
"code",
"test"
]
},
{
"login": "jpeterson976",
"name": "Jacob Peterson",
"avatar_url": "https://avatars.githubusercontent.com/u/46502440?v=4",
"profile": "https://github.com/jpeterson976",
"contributions": [
"code",
"test",
"review",
"bug"
]
},
{
"login": "maufcost",
"name": "Mauricio Figueiredo",
"name": "Mauricio Costa",
"avatar_url": "https://avatars1.githubusercontent.com/u/39862359?v=4",
"profile": "https://github.com/maufcost",
"contributions": [
"code",
"test"
"test",
"review",
"bug"
]
},
{
Expand Down Expand Up @@ -117,9 +164,14 @@
"avatar_url": "https://avatars1.githubusercontent.com/u/1275983?v=4",
"profile": "https://github.com/FrenjaminBanklin",
"contributions": [
"code",
"bug",
"code",
"doc",
"ideas",
"maintenance",
"projectManagement",
"test",
"tool",
"review"
]
},
Expand Down Expand Up @@ -182,11 +234,14 @@
"profile": "https://ianturgeon.com",
"contributions": [
"code",
"doc",
"test",
"ideas",
"infra",
"platform",
"projectManagement",
"maintenance",
"review",
"tool"
]
},
Expand All @@ -202,7 +257,8 @@
"design",
"ideas",
"projectManagement",
"review"
"review",
"tool"
]
}
],
Expand All @@ -211,5 +267,6 @@
"projectOwner": "ucfopen",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
"skipCi": true,
"commitConvention": "none"
}
2 changes: 1 addition & 1 deletion .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
daysUntilStale: 180

# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
daysUntilClose: false

# Issues with these labels will never be considered stale
exemptLabels:
Expand Down
43 changes: 24 additions & 19 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docker/obojobo-pm2-server-src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obojobo-pm2-server-app",
"version": "14.0.0",
"version": "15.0.0",
"description": "Reference project for deploying and customizing an Obojobo Next server",
"main": "./index.js",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/**/*"
],
"version": "14.0.0",
"version": "15.0.0",
"command": {
"command": {
"run": {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"test": "TZ='America/New_York' jest --verbose",
"test:ci": "TZ='America/New_York' CI=true jest --ci --useStderr --coverage --coverageReporters text-summary cobertura",
"test:ci:each": "lerna run test:ci",
"test:dev": "TZ='America/New_York' jest --verbose --watchAll --coverage --coverageReporters lcov",
"postinstall": "husky install"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ Array [
]
`;

exports[`NavStore nav:goto does not change page when locked 1`] = `undefined`;
exports[`NavStore nav:goto does not change page when locked if ignoreLock is false 1`] = `undefined`;

exports[`NavStore nav:gotoPath event calls gotoItem and postEvent 1`] = `
Array [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,94 @@ describe('NavStore', () => {
expect(Dispatcher.trigger).not.toHaveBeenCalled()
})

test('nav:goto does not change page when locked', () => {
test('nav:goto does nothing if payload is undefined', () => {
NavStore.setState({
isInitialized: true,
navTargetId: 7,
navTargetId: 'mockId',
itemsById: {
mockId: { id: 'mockId', flags: {} }
}
})

expect(Dispatcher.trigger).not.toHaveBeenCalled()
eventCallbacks['nav:goto']()
expect(Dispatcher.trigger).not.toHaveBeenCalled()
})

test('nav:goto does nothing if payload.value is undefined', () => {
NavStore.setState({
isInitialized: true,
navTargetId: 'mockId',
itemsById: {
mockId: { id: 'mockId', flags: {} }
}
})

expect(Dispatcher.trigger).not.toHaveBeenCalled()
eventCallbacks['nav:goto']({})
expect(Dispatcher.trigger).not.toHaveBeenCalled()
})

test('nav:goto still changes page when locked if ignoreLock is not provided', () => {
NavStore.setState({
isInitialized: true,
navTargetId: 'mockId',
navTargetHistory: [],
itemsById: {
mockId: { id: 'mockId', flags: {} }
},
locked: true
})

const spy = jest.spyOn(NavStore, 'gotoItem')
NavStore.gotoItem.mockReturnValueOnce(true)

// go
eventCallbacks['nav:goto']()
eventCallbacks['nav:goto']({ value: { id: 'mockId' } })
expect(NavStore.gotoItem).toHaveBeenCalledTimes(1)
expect(NavStore.gotoItem).toHaveBeenCalledWith({ flags: {}, id: 'mockId' })
expect(ViewerAPI.postEvent).toHaveBeenCalledTimes(1)

spy.mockRestore()
})

test('nav:goto still changes page when locked if ignoreLock is true', () => {
NavStore.setState({
isInitialized: true,
navTargetId: 'mockId',
navTargetHistory: [],
itemsById: {
mockId: { id: 'mockId', flags: {} }
},
locked: true
})

const spy = jest.spyOn(NavStore, 'gotoItem')
NavStore.gotoItem.mockReturnValueOnce(true)

// go
eventCallbacks['nav:goto']({ value: { id: 'mockId', ignoreLock: true } })
expect(NavStore.gotoItem).toHaveBeenCalledTimes(1)
expect(NavStore.gotoItem).toHaveBeenCalledWith({ flags: {}, id: 'mockId' })
expect(ViewerAPI.postEvent).toHaveBeenCalledTimes(1)

spy.mockRestore()
})

test('nav:goto does not change page when locked if ignoreLock is false', () => {
NavStore.setState({
isInitialized: true,
navTargetId: 'mockId',
itemsById: {
mockId: { id: 'mockId', flags: {} }
},
locked: true
})

const spy = jest.spyOn(NavStore, 'gotoItem')

// go
eventCallbacks['nav:goto']({ value: { id: 'mockId', ignoreLock: false } })
expect(NavStore.gotoItem).not.toHaveBeenCalled()
expect(ViewerAPI.postEvent).not.toHaveBeenCalled()
expect(ViewerAPI.postEvent.mock.calls[0]).toMatchSnapshot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,26 @@ describe('NavUtil', () => {
expect(x).toBe('mockTriggerReturn')
})

test('goto', () => {
test('goto (ignoreLock not provided)', () => {
expect(Common.flux.Dispatcher.trigger).not.toHaveBeenCalled()
const x = NavUtil.goto('mockId')
const expectedValue = {
value: {
id: 'mockId'
id: 'mockId',
ignoreLock: true
}
}
expect(Common.flux.Dispatcher.trigger).toHaveBeenCalledWith('nav:goto', expectedValue)
expect(x).toBe('mockTriggerReturn')
})

test('goto (ignoreLock provided)', () => {
expect(Common.flux.Dispatcher.trigger).not.toHaveBeenCalled()
const x = NavUtil.goto('mockId', false)
const expectedValue = {
value: {
id: 'mockId',
ignoreLock: false
}
}
expect(Common.flux.Dispatcher.trigger).toHaveBeenCalledWith('nav:goto', expectedValue)
Expand Down
Loading

0 comments on commit f5ce0e2

Please sign in to comment.