Skip to content

Commit

Permalink
test: 修改 react-native-mmkv-storage 测试demo (#1516)
Browse files Browse the repository at this point in the history
  • Loading branch information
TiHxdvt authored Nov 5, 2024
1 parent 1b7e99a commit bfc6fed
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion react-native-mmkv-storage/MMKVStorageTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,34 @@ const MMKVStorageTest = () => {
}}
/>

<TestCase
tags={['C_API']}
itShould="MMKV.clearStore();"
initialState={false}
arrange={({ setState }) => (
<View>
<TouchableOpacity
style={styles.moduleButton}
onPress={() => {
storageString.clearStore();
if (!storageString.options.key) {
setState(true)
} else {
setState(false)
}
}}
>
<Text style={styles.buttonText}>
清仓
</Text>
</TouchableOpacity>
</View>
)}
assert={({ state, expect }) => {
expect(state).to.be.true;
}}
/>

<TestCase
tags={['C_API']}
itShould="MMKV.getAllMMKVInstanceIDs();"
Expand Down Expand Up @@ -901,7 +929,6 @@ const MMKVStorageTest = () => {
/>
</View>


<View>
<TestCase
tags={['C_API']}
Expand Down

0 comments on commit bfc6fed

Please sign in to comment.