Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/00007-mobile_search' into 00007-…
Browse files Browse the repository at this point in the history
…mobile_search
  • Loading branch information
svienot committed May 3, 2022
2 parents 2ca4353 + 448b72c commit e55caa1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 30 deletions.
16 changes: 4 additions & 12 deletions src/components/transfer_graphs/TokenTransferGraphC.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,15 @@
v-bind:amount="tokenTransferLayout[s-1].netAmount"/>
</div>

<!-- #3 : token symbol -->
<div data-cy="tokenExtra">
<TokenExtra v-if="i === 1"
v-bind:token-id="tokenTransferLayout[s-1].tokenId"
v-bind:use-anchor="false"/>
</div>

<!-- #4 : arrow -->
<!-- #3 : arrow -->
<div style="position: relative">
<ArrowSegment
v-bind:dest-count="tokenTransferLayout[s-1].destinations.length"
v-bind:compact="true"
v-bind:row-index="i-1"/>
</div>

<!-- #5 : account id -->
<!-- #4 : account id -->
<div>
<template v-if="i <= tokenTransferLayout[s-1].destinations.length">
<AccountLink v-bind:account-id="tokenTransferLayout[s-1].destinations[i-1].account"
Expand Down Expand Up @@ -104,11 +97,10 @@ import TokenAmount from "@/components/values/TokenAmount.vue";
import ArrowSegment from "@/components/transfer_graphs/ArrowSegment.vue";
import {TokenTransferLayout} from "@/components/transfer_graphs/layout/TokenTransferLayout";
import {Transaction} from "@/schemas/HederaSchemas";
import TokenExtra from "@/components/values/TokenExtra.vue";

export default defineComponent({
name: "TokenTransferGraphC",
components: {AccountLink, TokenAmount, ArrowSegment, TokenExtra},
components: {AccountLink, TokenAmount, ArrowSegment},
props: {
transaction: Object as PropType<Transaction>
},
Expand Down Expand Up @@ -136,7 +128,7 @@ export default defineComponent({

.graph-container {
display: inline-grid;
grid-template-columns: repeat(6, auto);
grid-template-columns: repeat(5, auto);
column-gap: 1em
}

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/dashboard/MainDashboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe("MainDashboard.vue", () => {
expect(t0.get('thead').text()).toBe("ID Content Time")
expect(t0.get('tbody').text()).toBe(
"0.0.29624024@1646025139.1529014980.0.29624024\n\n" +
"123423\n\n" +
"1\n\n" +
"0.0.296939115:12:31.6676 AMFeb 28, 2022"
)

Expand All @@ -108,7 +108,7 @@ describe("MainDashboard.vue", () => {
expect(t1.get('thead').text()).toBe("ID Content Time")
expect(t1.get('tbody').text()).toBe(
"0.0.29624024@1646025139.1529014980.0.29624024\n\n" +
"123423\n\n" +
"1\n\n" +
"0.0.296939115:12:31.6676 AMFeb 28, 2022"
)

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/transaction/TransactionTable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe("TransactionTable.vue", () => {
expect(wrapper.find('thead').text()).toBe("ID Type Content Time")
expect(wrapper.find('tbody').text()).toBe(
"0.0.29624024@1646025139.152901498CRYPTO TRANSFER0.0.29624024\n\n" +
"123423\n\n" +
"1\n\n" +
"0.0.296939115:12:31.6676 AMFeb 28, 2022"
)
});
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/transaction/Transactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe("Transactions.vue", () => {
expect(table.get('thead').text()).toBe("ID Type Content Time")
expect(table.get('tbody').text()).toBe(
"0.0.29624024@1646025139.152901498CRYPTO TRANSFER0.0.29624024\n\n" +
"123423\n\n" +
"1\n\n" +
"0.0.296939115:12:31.6676 AMFeb 28, 2022"
)
});
Expand Down
22 changes: 8 additions & 14 deletions tests/unit/transfer_graphs/TokenTransferGraphC.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ describe("TokenTransferGraphC.vue", () => {
// console.log(wrapper.html())
// console.log(wrapper.text())

expect(wrapper.text()).toBe("MINT\n\n1023423\n\n0.0.200")
expect(wrapper.text()).toMatch(SAMPLE_TOKEN.name)
expect(wrapper.text()).toBe("MINT\n\n10\n\n0.0.200")
})

test("Single token, single source, single dest", async () => {
Expand Down Expand Up @@ -116,9 +115,8 @@ describe("TokenTransferGraphC.vue", () => {

expect(wrapper.text()).toBe(
"0.0.100\n\n" +
"1023423\n\n" +
"10\n\n" +
"0.0.200")
expect(wrapper.text()).toMatch(SAMPLE_TOKEN.name)
})

test("Single token, single source, two dest", async () => {
Expand Down Expand Up @@ -149,10 +147,9 @@ describe("TokenTransferGraphC.vue", () => {

expect(wrapper.text()).toBe(
"0.0.100\n\n" +
"1023423\n\n" +
"10\n\n" +
"0.0.200\n\n\n\n" +
"0.0.201")
expect(wrapper.text()).toMatch(SAMPLE_TOKEN.name)
})

test("Single token, two sources, zero dest", async () => {
Expand Down Expand Up @@ -180,8 +177,7 @@ describe("TokenTransferGraphC.vue", () => {
// console.log(wrapper.html())
// console.log(wrapper.text())

expect(wrapper.text()).toBe("0.0.100\n\n1023423\n\nBURN0.0.101")
expect(wrapper.text()).toMatch(SAMPLE_TOKEN.name)
expect(wrapper.text()).toBe("0.0.100\n\n10\n\nBURN0.0.101")
})

test("Single token, two sources, single dest", async () => {
Expand Down Expand Up @@ -212,9 +208,8 @@ describe("TokenTransferGraphC.vue", () => {

expect(wrapper.text()).toBe(
"0.0.100\n\n" +
"1023423\n\n" +
"10\n\n" +
"0.0.2000.0.101")
expect(wrapper.text()).toMatch(SAMPLE_TOKEN.name)
})

test("Single token, two sources, two dest", async () => {
Expand Down Expand Up @@ -246,10 +241,9 @@ describe("TokenTransferGraphC.vue", () => {

expect(wrapper.text()).toBe(
"0.0.100\n\n" +
"1023423\n\n" +
"10\n\n" +
"0.0.2000.0.101\n\n\n\n" +
"0.0.201")
expect(wrapper.text()).toMatch(SAMPLE_TOKEN.name)
})


Expand Down Expand Up @@ -288,10 +282,10 @@ describe("TokenTransferGraphC.vue", () => {
// console.log(wrapper.text())

expect(wrapper.text()).toBe("0.0.100\n\n" +
"1023423\n\n" +
"10\n\n" +
"0.0.2000.0.101\n\n\n\n" +
"0.0.2010.0.100\n\n" +
"623423 DUDE\n\n" +
"6\n\n" +
"0.0.200")
})

Expand Down

0 comments on commit e55caa1

Please sign in to comment.