This repository has been archived by the owner on Jan 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1507 from erin-hughes/txn-view-1475
Created skeleton transaction web view Can be accessed by right-clicking on a smart contract in the gateways view (currently disabled in the package.json)
- Loading branch information
Showing
32 changed files
with
1,053 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ coverage | |
/src/ExtensionCommands.ts | ||
/cypress/videos | ||
/cypress/screenshots | ||
/jest-tests.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
steps: | ||
- bash: | | ||
npm run cypressCli | ||
env: | ||
DISPLAY: ':99.0' | ||
displayName: Run cypress tests | ||
condition: succeeded() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
steps: | ||
- bash: | | ||
npm run jestTest | ||
env: | ||
DISPLAY: ':99.0' | ||
displayName: Run jest tests | ||
condition: succeeded() | ||
- task: PublishCodeCoverageResults@1 | ||
condition: succeededOrFailed() | ||
inputs: | ||
codeCoverageTool: Cobertura | ||
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/clover.xml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import TransactionViewPage from '../../src/components/TransactionViewPage/TransactionViewPage'; | ||
import chai from 'chai'; | ||
import sinon from 'sinon'; | ||
import sinonChai from 'sinon-chai'; | ||
chai.should(); | ||
chai.use(sinonChai); | ||
|
||
describe('TransactionViewPage component', () => { | ||
|
||
let mySandBox: sinon.SinonSandbox; | ||
|
||
beforeEach(async () => { | ||
mySandBox = sinon.createSandbox(); | ||
}); | ||
|
||
afterEach(async () => { | ||
mySandBox.restore(); | ||
}); | ||
|
||
it('should render the expected snapshot', async () => { | ||
const component: any = renderer | ||
.create(<TransactionViewPage activeSmartContract="penguinContract@0.0.1"/>) | ||
.toJSON(); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import TransactionViewSidebar from '../../src/components/TransactionViewSidebar/TransactionViewSidebar'; | ||
import chai from 'chai'; | ||
import sinon from 'sinon'; | ||
import sinonChai from 'sinon-chai'; | ||
chai.should(); | ||
chai.use(sinonChai); | ||
|
||
describe('TransactionViewSidebar component', () => { | ||
|
||
let mySandBox: sinon.SinonSandbox; | ||
|
||
beforeEach(async () => { | ||
mySandBox = sinon.createSandbox(); | ||
}); | ||
|
||
afterEach(async () => { | ||
mySandBox.restore(); | ||
}); | ||
|
||
it('should render the expected snapshot', async () => { | ||
const component: any = renderer | ||
.create(<TransactionViewSidebar/>) | ||
.toJSON(); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import { mount } from 'enzyme'; | ||
import SidebarPanel from '../../src/components/TransactionViewSidebarPanel/TransactionViewSidebarPanel'; | ||
import chai from 'chai'; | ||
import sinon from 'sinon'; | ||
import sinonChai from 'sinon-chai'; | ||
chai.should(); | ||
chai.use(sinonChai); | ||
|
||
describe('SidebarPanel component', () => { | ||
|
||
let mySandBox: sinon.SinonSandbox; | ||
|
||
beforeEach(async () => { | ||
mySandBox = sinon.createSandbox(); | ||
}); | ||
|
||
afterEach(async () => { | ||
mySandBox.restore(); | ||
}); | ||
|
||
it('should render the expected snapshot when panelType = \`buttons\`', async () => { | ||
const component: any = renderer | ||
.create(<SidebarPanel panelType={'buttons'}></SidebarPanel>) | ||
.toJSON(); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render the expected snapshot when panelType = \`filters\`', async () => { | ||
const component: any = renderer | ||
.create(<SidebarPanel panelType={'filters'}></SidebarPanel>) | ||
.toJSON(); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render the expected snapshot when panelType = \`log\`', async () => { | ||
const component: any = renderer | ||
.create(<SidebarPanel panelType={'log'}></SidebarPanel>) | ||
.toJSON(); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
it('will one day allow a user to create a new transaction', async() => { | ||
const createTxnSpy: sinon.SinonSpy = sinon.spy(SidebarPanel.prototype, 'createTxn'); | ||
const component: any = mount(<SidebarPanel panelType='buttons'></SidebarPanel>); | ||
component.find('button[id=\'create-button\']').simulate('click'); | ||
createTxnSpy.should.have.been.called; | ||
}); | ||
|
||
it('will one day allow a user to create a new transaction', async() => { | ||
const importTxnSpy: sinon.SinonSpy = sinon.spy(SidebarPanel.prototype, 'importTxn'); | ||
const component: any = mount(<SidebarPanel panelType='buttons'></SidebarPanel>); | ||
component.find('button[id=\'import-button\']').simulate('click'); | ||
importTxnSpy.should.have.been.called; | ||
}); | ||
|
||
}); |
Oops, something went wrong.